<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE DeriveDataTypeable #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE ExistentialQuantification #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE FlexibleContexts #-}</span><span>
</span><span id="line-5"></span><span class="hs-pragma">{-# LANGUAGE FlexibleInstances #-}</span><span>
</span><span id="line-6"></span><span class="hs-pragma">{-# LANGUAGE FunctionalDependencies #-}</span><span>
</span><span id="line-7"></span><span class="hs-pragma">{-# LANGUAGE MultiParamTypeClasses #-}</span><span>
</span><span id="line-8"></span><span class="hs-pragma">{-# LANGUAGE PolymorphicComponents #-}</span><span>
</span><span id="line-9"></span><span class="hs-pragma">{-# LANGUAGE Safe #-}</span><span>
</span><span id="line-10"></span><span class="hs-pragma">{-# LANGUAGE StandaloneDeriving #-}</span><span>
</span><span id="line-11"></span><span class="hs-pragma">{-# LANGUAGE UndecidableInstances #-}</span><span>
</span><span id="line-12"></span><span>
</span><span id="line-13"></span><span class="hs-pragma">{-# OPTIONS_GHC -fno-warn-name-shadowing #-}</span><span>
</span><span id="line-14"></span><span>
</span><span id="line-15"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- Module      :  Text.Parsec.Prim</span><span>
</span><span id="line-18"></span><span class="hs-comment">-- Copyright   :  (c) Daan Leijen 1999-2001, (c) Paolo Martini 2007</span><span>
</span><span id="line-19"></span><span class="hs-comment">-- License     :  BSD-style (see the LICENSE file)</span><span>
</span><span id="line-20"></span><span class="hs-comment">--</span><span>
</span><span id="line-21"></span><span class="hs-comment">-- Maintainer  :  derek.a.elkins@gmail.com</span><span>
</span><span id="line-22"></span><span class="hs-comment">-- Stability   :  provisional</span><span>
</span><span id="line-23"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-24"></span><span class="hs-comment">--</span><span>
</span><span id="line-25"></span><span class="hs-comment">-- The primitive parser combinators.</span><span>
</span><span id="line-26"></span><span class="hs-comment">--</span><span>
</span><span id="line-27"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span class="hs-pragma">{-# OPTIONS_HADDOCK not-home #-}</span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Text.Parsec.Prim</span><span>
</span><span id="line-32"></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#unknownError"><span class="hs-identifier">unknownError</span></a></span><span>
</span><span id="line-33"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#sysUnExpectError"><span class="hs-identifier">sysUnExpectError</span></a></span><span>
</span><span id="line-34"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#unexpected"><span class="hs-identifier">unexpected</span></a></span><span>
</span><span id="line-35"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier">ParsecT</span></a></span><span>
</span><span id="line-36"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#runParsecT"><span class="hs-identifier">runParsecT</span></a></span><span>
</span><span id="line-37"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#mkPT"><span class="hs-identifier">mkPT</span></a></span><span>
</span><span id="line-38"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#Parsec"><span class="hs-identifier">Parsec</span></a></span><span>
</span><span id="line-39"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#Consumed"><span class="hs-identifier">Consumed</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-40"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#Reply"><span class="hs-identifier">Reply</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-41"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier">State</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-42"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#parsecMap"><span class="hs-identifier">parsecMap</span></a></span><span>
</span><span id="line-43"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#parserReturn"><span class="hs-identifier">parserReturn</span></a></span><span>
</span><span id="line-44"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#parserBind"><span class="hs-identifier">parserBind</span></a></span><span>
</span><span id="line-45"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#mergeErrorReply"><span class="hs-identifier">mergeErrorReply</span></a></span><span>
</span><span id="line-46"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#parserFail"><span class="hs-identifier">parserFail</span></a></span><span>
</span><span id="line-47"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#parserZero"><span class="hs-identifier">parserZero</span></a></span><span>
</span><span id="line-48"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#parserPlus"><span class="hs-identifier">parserPlus</span></a></span><span>
</span><span id="line-49"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#%3C%3F%3E"><span class="hs-operator">(&lt;?&gt;)</span></a></span><span>
</span><span id="line-50"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#%3C%7C%3E"><span class="hs-operator">(&lt;|&gt;)</span></a></span><span>
</span><span id="line-51"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#label"><span class="hs-keyword">label</span></a></span><span>
</span><span id="line-52"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#labels"><span class="hs-identifier">labels</span></a></span><span>
</span><span id="line-53"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#lookAhead"><span class="hs-identifier">lookAhead</span></a></span><span>
</span><span id="line-54"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#Stream"><span class="hs-identifier">Stream</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-55"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#tokens"><span class="hs-identifier">tokens</span></a></span><span>
</span><span id="line-56"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#try"><span class="hs-identifier">try</span></a></span><span>
</span><span id="line-57"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#token"><span class="hs-identifier">token</span></a></span><span>
</span><span id="line-58"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#tokenPrim"><span class="hs-identifier">tokenPrim</span></a></span><span>
</span><span id="line-59"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#tokenPrimEx"><span class="hs-identifier">tokenPrimEx</span></a></span><span>
</span><span id="line-60"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#many"><span class="hs-identifier">many</span></a></span><span>
</span><span id="line-61"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#skipMany"><span class="hs-identifier">skipMany</span></a></span><span>
</span><span id="line-62"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#manyAccum"><span class="hs-identifier">manyAccum</span></a></span><span>
</span><span id="line-63"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#runPT"><span class="hs-identifier">runPT</span></a></span><span>
</span><span id="line-64"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#runP"><span class="hs-identifier">runP</span></a></span><span>
</span><span id="line-65"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#runParserT"><span class="hs-identifier">runParserT</span></a></span><span>
</span><span id="line-66"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#runParser"><span class="hs-identifier">runParser</span></a></span><span>
</span><span id="line-67"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#parse"><span class="hs-identifier">parse</span></a></span><span>
</span><span id="line-68"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#parseTest"><span class="hs-identifier">parseTest</span></a></span><span>
</span><span id="line-69"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#getPosition"><span class="hs-identifier">getPosition</span></a></span><span>
</span><span id="line-70"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#getInput"><span class="hs-identifier">getInput</span></a></span><span>
</span><span id="line-71"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#setPosition"><span class="hs-identifier">setPosition</span></a></span><span>
</span><span id="line-72"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#setInput"><span class="hs-identifier">setInput</span></a></span><span>
</span><span id="line-73"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#getParserState"><span class="hs-identifier">getParserState</span></a></span><span>
</span><span id="line-74"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#setParserState"><span class="hs-identifier">setParserState</span></a></span><span>
</span><span id="line-75"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#updateParserState"><span class="hs-identifier">updateParserState</span></a></span><span>
</span><span id="line-76"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#getState"><span class="hs-identifier">getState</span></a></span><span>
</span><span id="line-77"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#putState"><span class="hs-identifier">putState</span></a></span><span>
</span><span id="line-78"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#modifyState"><span class="hs-identifier">modifyState</span></a></span><span>
</span><span id="line-79"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#setState"><span class="hs-identifier">setState</span></a></span><span>
</span><span id="line-80"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#updateState"><span class="hs-identifier">updateState</span></a></span><span>
</span><span id="line-81"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span>
</span><span id="line-84"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Traversable.html#sequence"><span class="hs-identifier">sequence</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-85"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Char8.html#"><span class="hs-identifier">Data.ByteString.Lazy.Char8</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">CL</span></span><span>
</span><span id="line-86"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Char8.html#"><span class="hs-identifier">Data.ByteString.Char8</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">C</span></span><span>
</span><span id="line-87"></span><span>
</span><span id="line-88"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Typeable.html#"><span class="hs-identifier">Data.Typeable</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Typeable.Internal.html#Typeable"><span class="hs-identifier">Typeable</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-89"></span><span>
</span><span id="line-90"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../text/src/Data.Text.html#"><span class="hs-identifier">Data.Text</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Text</span></span><span>
</span><span id="line-91"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../text/src/Data.Text.Lazy.html#"><span class="hs-identifier">Data.Text.Lazy</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">TextL</span></span><span>
</span><span id="line-92"></span><span>
</span><span id="line-93"></span><span class="hs-comment">-- To define Monoid instance</span><span>
</span><span id="line-94"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Data.List.NonEmpty.html#"><span class="hs-identifier">Data.List.NonEmpty</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">NE</span></span><span>
</span><span id="line-95"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.OldList.html#genericReplicate"><span class="hs-identifier">genericReplicate</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-96"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Traversable.html#"><span class="hs-identifier">Data.Traversable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Traversable.html#sequence"><span class="hs-identifier">sequence</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-97"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.html#"><span class="hs-identifier">Data.Functor</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Functor</span></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier">Functor</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-98"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.html#"><span class="hs-identifier">Data.Semigroup</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Semigroup</span></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Semigroup"><span class="hs-identifier">Semigroup</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-99"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Data.Monoid.html#"><span class="hs-identifier">Data.Monoid</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Monoid</span></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier">Monoid</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-100"></span><span>
</span><span id="line-101"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Control.Applicative.html#"><span class="hs-identifier">Control.Applicative</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Applicative</span></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Applicative"><span class="hs-identifier">Applicative</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Alternative"><span class="hs-identifier">Alternative</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#liftA2"><span class="hs-identifier">liftA2</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-102"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Traversable.html#sequence"><span class="hs-identifier">sequence</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-103"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../mtl/src/Control.Monad.Trans.html#"><span class="hs-identifier">Control.Monad.Trans</span></a></span><span>
</span><span id="line-104"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../mtl/src/Control.Monad.Identity.html#"><span class="hs-identifier">Control.Monad.Identity</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Traversable.html#sequence"><span class="hs-identifier">sequence</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-105"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.Fail.html#"><span class="hs-identifier">Control.Monad.Fail</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Fail</span></span><span>
</span><span id="line-106"></span><span>
</span><span id="line-107"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../mtl/src/Control.Monad.Reader.Class.html#"><span class="hs-identifier">Control.Monad.Reader.Class</span></a></span><span>
</span><span id="line-108"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../mtl/src/Control.Monad.State.Class.html#"><span class="hs-identifier">Control.Monad.State.Class</span></a></span><span>
</span><span id="line-109"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../mtl/src/Control.Monad.Cont.Class.html#"><span class="hs-identifier">Control.Monad.Cont.Class</span></a></span><span>
</span><span id="line-110"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../mtl/src/Control.Monad.Error.Class.html#"><span class="hs-identifier">Control.Monad.Error.Class</span></a></span><span>
</span><span id="line-111"></span><span>
</span><span id="line-112"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html"><span class="hs-identifier">Text.Parsec.Pos</span></a></span><span>
</span><span id="line-113"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Text.Parsec.Error.html"><span class="hs-identifier">Text.Parsec.Error</span></a></span><span>
</span><span id="line-114"></span><span>
</span><span id="line-115"></span><span id="local-6989586621679059803"><span id="local-6989586621679059804"><span class="annot"><a href="Text.Parsec.Prim.html#unknownError"><span class="hs-identifier hs-type">unknownError</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059804"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059803"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Error.html#ParseError"><span class="hs-identifier hs-type">ParseError</span></a></span></span></span><span>
</span><span id="line-116"></span><span id="unknownError"><span class="annot"><span class="annottext">unknownError :: forall s u. State s u -&gt; ParseError
</span><a href="Text.Parsec.Prim.html#unknownError"><span class="hs-identifier hs-var hs-var">unknownError</span></a></span></span><span> </span><span id="local-6989586621679059149"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679059149"><span class="hs-identifier hs-var">state</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SourcePos -&gt; ParseError
</span><a href="Text.Parsec.Error.html#newErrorUnknown"><span class="hs-identifier hs-var">newErrorUnknown</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">State s u -&gt; SourcePos
forall s u. State s u -&gt; SourcePos
</span><a href="Text.Parsec.Prim.html#statePos"><span class="hs-identifier hs-var hs-var">statePos</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679059149"><span class="hs-identifier hs-var">state</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-117"></span><span>
</span><span id="line-118"></span><span id="local-6989586621679059793"><span id="local-6989586621679059794"><span id="local-6989586621679059795"><span class="annot"><a href="Text.Parsec.Prim.html#sysUnExpectError"><span class="hs-identifier hs-type">sysUnExpectError</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#Reply"><span class="hs-identifier hs-type">Reply</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059795"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059794"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059793"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-119"></span><span id="sysUnExpectError"><span class="annot"><span class="annottext">sysUnExpectError :: forall s u a. String -&gt; SourcePos -&gt; Reply s u a
</span><a href="Text.Parsec.Prim.html#sysUnExpectError"><span class="hs-identifier hs-var hs-var">sysUnExpectError</span></a></span></span><span> </span><span id="local-6989586621679059146"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059146"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span id="local-6989586621679059145"><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679059145"><span class="hs-identifier hs-var">pos</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; Reply s u a
forall s u a. ParseError -&gt; Reply s u a
</span><a href="Text.Parsec.Prim.html#Error"><span class="hs-identifier hs-var">Error</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Message -&gt; SourcePos -&gt; ParseError
</span><a href="Text.Parsec.Error.html#newErrorMessage"><span class="hs-identifier hs-var">newErrorMessage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Message
</span><a href="Text.Parsec.Error.html#SysUnExpect"><span class="hs-identifier hs-var">SysUnExpect</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059146"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679059145"><span class="hs-identifier hs-var">pos</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-120"></span><span>
</span><span id="line-121"></span><span class="hs-comment">-- | The parser @unexpected msg@ always fails with an unexpected error</span><span>
</span><span id="line-122"></span><span class="hs-comment">-- message @msg@ without consuming any input.</span><span>
</span><span id="line-123"></span><span class="hs-comment">--</span><span>
</span><span id="line-124"></span><span class="hs-comment">-- The parsers 'fail', ('&lt;?&gt;') and @unexpected@ are the three parsers</span><span>
</span><span id="line-125"></span><span class="hs-comment">-- used to generate error messages. Of these, only ('&lt;?&gt;') is commonly</span><span>
</span><span id="line-126"></span><span class="hs-comment">-- used. For an example of the use of @unexpected@, see the definition</span><span>
</span><span id="line-127"></span><span class="hs-comment">-- of 'Text.Parsec.Combinator.notFollowedBy'.</span><span>
</span><span id="line-128"></span><span>
</span><span id="line-129"></span><span id="local-6989586621679059780"><span id="local-6989586621679059781"><span id="local-6989586621679059783"><span id="local-6989586621679059784"><span id="local-6989586621679059785"><span class="annot"><a href="Text.Parsec.Prim.html#unexpected"><span class="hs-identifier hs-type">unexpected</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#Stream"><span class="hs-identifier hs-type">Stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059785"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059784"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059783"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059785"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059781"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059784"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059780"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span></span><span>
</span><span id="line-130"></span><span id="unexpected"><span class="annot"><span class="annottext">unexpected :: forall s (m :: * -&gt; *) t u a.
Stream s m t =&gt;
String -&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#unexpected"><span class="hs-identifier hs-var hs-var">unexpected</span></a></span></span><span> </span><span id="local-6989586621679059140"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059140"><span class="hs-identifier hs-var">msg</span></a></span></span><span>
</span><span id="line-131"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
forall s u (m :: * -&gt; *) a.
(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-var">ParsecT</span></a></span><span> </span><span class="annot"><span class="annottext">((forall b.
  State s u
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; m b)
 -&gt; ParsecT s u m a)
-&gt; (forall b.
    State s u
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; m b)
-&gt; ParsecT s u m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679059138"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679059138"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679059137"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679059137"><span class="hs-identifier hs-var">eerr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-132"></span><span>      </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679059137"><span class="hs-identifier hs-var">eerr</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseError -&gt; m b) -&gt; ParseError -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Message -&gt; SourcePos -&gt; ParseError
</span><a href="Text.Parsec.Error.html#newErrorMessage"><span class="hs-identifier hs-var">newErrorMessage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Message
</span><a href="Text.Parsec.Error.html#UnExpect"><span class="hs-identifier hs-var">UnExpect</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059140"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">State s u -&gt; SourcePos
forall s u. State s u -&gt; SourcePos
</span><a href="Text.Parsec.Prim.html#statePos"><span class="hs-identifier hs-var hs-var">statePos</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679059138"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-133"></span><span>
</span><span id="line-134"></span><span class="hs-comment">-- | ParserT monad transformer and Parser type</span><span>
</span><span id="line-135"></span><span>
</span><span id="line-136"></span><span class="hs-comment">-- | @ParsecT s u m a@ is a parser with stream type @s@, user state type @u@,</span><span>
</span><span id="line-137"></span><span class="hs-comment">-- underlying monad @m@ and return type @a@.  Parsec is strict in the user state.</span><span>
</span><span id="line-138"></span><span class="hs-comment">-- If this is undesirable, simply use a data type like @data Box a = Box a@ and</span><span>
</span><span id="line-139"></span><span class="hs-comment">-- the state type @Box YourStateType@ to add a level of indirection.</span><span>
</span><span id="line-140"></span><span>
</span><span id="line-141"></span><span class="hs-keyword">newtype</span><span> </span><span id="ParsecT"><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-var">ParsecT</span></a></span></span><span> </span><span id="local-6989586621679059773"><span class="annot"><a href="#local-6989586621679059773"><span class="hs-identifier hs-type">s</span></a></span></span><span> </span><span id="local-6989586621679059772"><span class="annot"><a href="#local-6989586621679059772"><span class="hs-identifier hs-type">u</span></a></span></span><span> </span><span id="local-6989586621679059770"><span class="annot"><a href="#local-6989586621679059770"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span id="local-6989586621679059771"><span class="annot"><a href="#local-6989586621679059771"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-142"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span id="ParsecT"><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-var">ParsecT</span></a></span></span><span> </span><span class="hs-special">{</span><span id="unParser"><span class="annot"><span class="annottext">forall s u (m :: * -&gt; *) a.
ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
</span><a href="Text.Parsec.Prim.html#unParser"><span class="hs-identifier hs-var hs-var">unParser</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679059774"><span class="annot"><a href="#local-6989586621679059774"><span class="hs-identifier hs-type">b</span></a></span></span><span> </span><span class="hs-operator">.</span><span>
</span><span id="line-143"></span><span>                 </span><span class="annot"><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059773"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059772"><span class="hs-identifier hs-type">u</span></a></span><span>
</span><span id="line-144"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059771"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059773"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059772"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Error.html#ParseError"><span class="hs-identifier hs-type">ParseError</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059770"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059774"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- consumed ok</span><span>
</span><span id="line-145"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Error.html#ParseError"><span class="hs-identifier hs-type">ParseError</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059770"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059774"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span>                   </span><span class="hs-comment">-- consumed err</span><span>
</span><span id="line-146"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059771"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059773"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059772"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Error.html#ParseError"><span class="hs-identifier hs-type">ParseError</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059770"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059774"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- empty ok</span><span>
</span><span id="line-147"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Error.html#ParseError"><span class="hs-identifier hs-type">ParseError</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059770"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059774"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span>                   </span><span class="hs-comment">-- empty err</span><span>
</span><span id="line-148"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059770"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059774"><span class="hs-identifier hs-type">b</span></a></span><span>
</span><span id="line-149"></span><span>             </span><span class="hs-special">}</span><span class="hs-cpp">
#if MIN_VERSION_base(4,7,0)
</span><span>     </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Typeable.Internal.html#Typeable"><span class="hs-identifier hs-type">Typeable</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-152"></span><span>     </span><span class="hs-comment">-- GHC 7.6 doesn't like deriving instances of Typeabl1 for types with</span><span>
</span><span id="line-153"></span><span>     </span><span class="hs-comment">-- non-* type-arguments.</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-156"></span><span class="hs-comment">-- | Low-level unpacking of the ParsecT type. To run your parser, please look to</span><span>
</span><span id="line-157"></span><span class="hs-comment">-- runPT, runP, runParserT, runParser and other such functions.</span><span>
</span><span id="line-158"></span><span id="local-6989586621679059757"><span id="local-6989586621679059758"><span id="local-6989586621679059759"><span id="local-6989586621679059760"><span class="annot"><a href="Text.Parsec.Prim.html#runParsecT"><span class="hs-identifier hs-type">runParsecT</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059760"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059759"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059758"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059760"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059757"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059759"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059758"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059760"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#Consumed"><span class="hs-identifier hs-type">Consumed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059760"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#Reply"><span class="hs-identifier hs-type">Reply</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059759"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059758"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059757"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span></span></span></span></span><span>
</span><span id="line-159"></span><span class="hs-pragma">{-# INLINABLE</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#runParsecT"><span class="hs-pragma hs-type">runParsecT</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-160"></span><span id="runParsecT"><span class="annot"><span class="annottext">runParsecT :: forall (m :: * -&gt; *) s u a.
Monad m =&gt;
ParsecT s u m a -&gt; State s u -&gt; m (Consumed (m (Reply s u a)))
</span><a href="Text.Parsec.Prim.html#runParsecT"><span class="hs-identifier hs-var hs-var">runParsecT</span></a></span></span><span> </span><span id="local-6989586621679059125"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679059125"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679059124"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679059124"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
forall s u (m :: * -&gt; *) a.
ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
</span><a href="Text.Parsec.Prim.html#unParser"><span class="hs-identifier hs-var hs-var">unParser</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679059125"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679059124"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m (Consumed (m (Reply s u a)))
forall {m :: * -&gt; *} {m :: * -&gt; *} {a} {s} {u}.
(Monad m, Monad m) =&gt;
a -&gt; State s u -&gt; ParseError -&gt; m (Consumed (m (Reply s u a)))
</span><a href="#local-6989586621679059123"><span class="hs-identifier hs-var">cok</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m (Consumed (m (Reply s u a)))
forall {m :: * -&gt; *} {m :: * -&gt; *} {s} {u} {a}.
(Monad m, Monad m) =&gt;
ParseError -&gt; m (Consumed (m (Reply s u a)))
</span><a href="#local-6989586621679059122"><span class="hs-identifier hs-var">cerr</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m (Consumed (m (Reply s u a)))
forall {m :: * -&gt; *} {m :: * -&gt; *} {a} {s} {u}.
(Monad m, Monad m) =&gt;
a -&gt; State s u -&gt; ParseError -&gt; m (Consumed (m (Reply s u a)))
</span><a href="#local-6989586621679059121"><span class="hs-identifier hs-var">eok</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m (Consumed (m (Reply s u a)))
forall {m :: * -&gt; *} {m :: * -&gt; *} {s} {u} {a}.
(Monad m, Monad m) =&gt;
ParseError -&gt; m (Consumed (m (Reply s u a)))
</span><a href="#local-6989586621679059120"><span class="hs-identifier hs-var">eerr</span></a></span><span>
</span><span id="line-161"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679059123"><span class="annot"><span class="annottext">cok :: a -&gt; State s u -&gt; ParseError -&gt; m (Consumed (m (Reply s u a)))
</span><a href="#local-6989586621679059123"><span class="hs-identifier hs-var hs-var">cok</span></a></span></span><span> </span><span id="local-6989586621679059115"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679059115"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679059114"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679059114"><span class="hs-identifier hs-var">s'</span></a></span></span><span> </span><span id="local-6989586621679059113"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679059113"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Consumed (m (Reply s u a)) -&gt; m (Consumed (m (Reply s u a)))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Consumed (m (Reply s u a)) -&gt; m (Consumed (m (Reply s u a))))
-&gt; (Reply s u a -&gt; Consumed (m (Reply s u a)))
-&gt; Reply s u a
-&gt; m (Consumed (m (Reply s u a)))
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">m (Reply s u a) -&gt; Consumed (m (Reply s u a))
forall a. a -&gt; Consumed a
</span><a href="Text.Parsec.Prim.html#Consumed"><span class="hs-identifier hs-var">Consumed</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Reply s u a) -&gt; Consumed (m (Reply s u a)))
-&gt; (Reply s u a -&gt; m (Reply s u a))
-&gt; Reply s u a
-&gt; Consumed (m (Reply s u a))
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Reply s u a -&gt; m (Reply s u a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Reply s u a -&gt; m (Consumed (m (Reply s u a))))
-&gt; Reply s u a -&gt; m (Consumed (m (Reply s u a)))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; Reply s u a
forall s u a. a -&gt; State s u -&gt; ParseError -&gt; Reply s u a
</span><a href="Text.Parsec.Prim.html#Ok"><span class="hs-identifier hs-var">Ok</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679059115"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679059114"><span class="hs-identifier hs-var">s'</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679059113"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-162"></span><span>          </span><span id="local-6989586621679059122"><span class="annot"><span class="annottext">cerr :: ParseError -&gt; m (Consumed (m (Reply s u a)))
</span><a href="#local-6989586621679059122"><span class="hs-identifier hs-var hs-var">cerr</span></a></span></span><span> </span><span id="local-6989586621679059105"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679059105"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Consumed (m (Reply s u a)) -&gt; m (Consumed (m (Reply s u a)))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Consumed (m (Reply s u a)) -&gt; m (Consumed (m (Reply s u a))))
-&gt; (Reply s u a -&gt; Consumed (m (Reply s u a)))
-&gt; Reply s u a
-&gt; m (Consumed (m (Reply s u a)))
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">m (Reply s u a) -&gt; Consumed (m (Reply s u a))
forall a. a -&gt; Consumed a
</span><a href="Text.Parsec.Prim.html#Consumed"><span class="hs-identifier hs-var">Consumed</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Reply s u a) -&gt; Consumed (m (Reply s u a)))
-&gt; (Reply s u a -&gt; m (Reply s u a))
-&gt; Reply s u a
-&gt; Consumed (m (Reply s u a))
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Reply s u a -&gt; m (Reply s u a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Reply s u a -&gt; m (Consumed (m (Reply s u a))))
-&gt; Reply s u a -&gt; m (Consumed (m (Reply s u a)))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; Reply s u a
forall s u a. ParseError -&gt; Reply s u a
</span><a href="Text.Parsec.Prim.html#Error"><span class="hs-identifier hs-var">Error</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679059105"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-163"></span><span>          </span><span id="local-6989586621679059121"><span class="annot"><span class="annottext">eok :: a -&gt; State s u -&gt; ParseError -&gt; m (Consumed (m (Reply s u a)))
</span><a href="#local-6989586621679059121"><span class="hs-identifier hs-var hs-var">eok</span></a></span></span><span> </span><span id="local-6989586621679059100"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679059100"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679059099"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679059099"><span class="hs-identifier hs-var">s'</span></a></span></span><span> </span><span id="local-6989586621679059098"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679059098"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Consumed (m (Reply s u a)) -&gt; m (Consumed (m (Reply s u a)))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Consumed (m (Reply s u a)) -&gt; m (Consumed (m (Reply s u a))))
-&gt; (Reply s u a -&gt; Consumed (m (Reply s u a)))
-&gt; Reply s u a
-&gt; m (Consumed (m (Reply s u a)))
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">m (Reply s u a) -&gt; Consumed (m (Reply s u a))
forall a. a -&gt; Consumed a
</span><a href="Text.Parsec.Prim.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Reply s u a) -&gt; Consumed (m (Reply s u a)))
-&gt; (Reply s u a -&gt; m (Reply s u a))
-&gt; Reply s u a
-&gt; Consumed (m (Reply s u a))
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Reply s u a -&gt; m (Reply s u a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Reply s u a -&gt; m (Consumed (m (Reply s u a))))
-&gt; Reply s u a -&gt; m (Consumed (m (Reply s u a)))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; Reply s u a
forall s u a. a -&gt; State s u -&gt; ParseError -&gt; Reply s u a
</span><a href="Text.Parsec.Prim.html#Ok"><span class="hs-identifier hs-var">Ok</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679059100"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679059099"><span class="hs-identifier hs-var">s'</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679059098"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-164"></span><span>          </span><span id="local-6989586621679059120"><span class="annot"><span class="annottext">eerr :: ParseError -&gt; m (Consumed (m (Reply s u a)))
</span><a href="#local-6989586621679059120"><span class="hs-identifier hs-var hs-var">eerr</span></a></span></span><span> </span><span id="local-6989586621679059092"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679059092"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Consumed (m (Reply s u a)) -&gt; m (Consumed (m (Reply s u a)))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Consumed (m (Reply s u a)) -&gt; m (Consumed (m (Reply s u a))))
-&gt; (Reply s u a -&gt; Consumed (m (Reply s u a)))
-&gt; Reply s u a
-&gt; m (Consumed (m (Reply s u a)))
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">m (Reply s u a) -&gt; Consumed (m (Reply s u a))
forall a. a -&gt; Consumed a
</span><a href="Text.Parsec.Prim.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Reply s u a) -&gt; Consumed (m (Reply s u a)))
-&gt; (Reply s u a -&gt; m (Reply s u a))
-&gt; Reply s u a
-&gt; Consumed (m (Reply s u a))
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Reply s u a -&gt; m (Reply s u a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Reply s u a -&gt; m (Consumed (m (Reply s u a))))
-&gt; Reply s u a -&gt; m (Consumed (m (Reply s u a)))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; Reply s u a
forall s u a. ParseError -&gt; Reply s u a
</span><a href="Text.Parsec.Prim.html#Error"><span class="hs-identifier hs-var">Error</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679059092"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-165"></span><span>
</span><span id="line-166"></span><span class="hs-comment">-- | Low-level creation of the ParsecT type. You really shouldn't have to do this.</span><span>
</span><span id="line-167"></span><span id="local-6989586621679059723"><span id="local-6989586621679059724"><span id="local-6989586621679059725"><span id="local-6989586621679059726"><span class="annot"><a href="Text.Parsec.Prim.html#mkPT"><span class="hs-identifier hs-type">mkPT</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059726"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059725"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059724"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059726"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#Consumed"><span class="hs-identifier hs-type">Consumed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059726"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#Reply"><span class="hs-identifier hs-type">Reply</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059725"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059724"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059723"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059725"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059724"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059726"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059723"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span><span>
</span><span id="line-168"></span><span class="hs-pragma">{-# INLINABLE</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#mkPT"><span class="hs-pragma hs-type">mkPT</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-169"></span><span id="mkPT"><span class="annot"><span class="annottext">mkPT :: forall (m :: * -&gt; *) s u a.
Monad m =&gt;
(State s u -&gt; m (Consumed (m (Reply s u a)))) -&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#mkPT"><span class="hs-identifier hs-var hs-var">mkPT</span></a></span></span><span> </span><span id="local-6989586621679059090"><span class="annot"><span class="annottext">State s u -&gt; m (Consumed (m (Reply s u a)))
</span><a href="#local-6989586621679059090"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
forall s u (m :: * -&gt; *) a.
(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-var">ParsecT</span></a></span><span> </span><span class="annot"><span class="annottext">((forall b.
  State s u
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; m b)
 -&gt; ParsecT s u m a)
-&gt; (forall b.
    State s u
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; m b)
-&gt; ParsecT s u m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679059086"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679059086"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679059085"><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679059085"><span class="hs-identifier hs-var">cok</span></a></span></span><span> </span><span id="local-6989586621679059084"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679059084"><span class="hs-identifier hs-var">cerr</span></a></span></span><span> </span><span id="local-6989586621679059083"><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679059083"><span class="hs-identifier hs-var">eok</span></a></span></span><span> </span><span id="local-6989586621679059082"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679059082"><span class="hs-identifier hs-var">eerr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-170"></span><span>           </span><span id="local-6989586621679059081"><span class="annot"><span class="annottext">Consumed (m (Reply s u a))
</span><a href="#local-6989586621679059081"><span class="hs-identifier hs-var">cons</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">State s u -&gt; m (Consumed (m (Reply s u a)))
</span><a href="#local-6989586621679059090"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679059086"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-171"></span><span>           </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Consumed (m (Reply s u a))
</span><a href="#local-6989586621679059081"><span class="hs-identifier hs-var">cons</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-172"></span><span>             </span><span class="annot"><a href="Text.Parsec.Prim.html#Consumed"><span class="hs-identifier hs-type">Consumed</span></a></span><span> </span><span id="local-6989586621679059080"><span class="annot"><span class="annottext">m (Reply s u a)
</span><a href="#local-6989586621679059080"><span class="hs-identifier hs-var">mrep</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-173"></span><span>                       </span><span id="local-6989586621679059079"><span class="annot"><span class="annottext">Reply s u a
</span><a href="#local-6989586621679059079"><span class="hs-identifier hs-var">rep</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m (Reply s u a)
</span><a href="#local-6989586621679059080"><span class="hs-identifier hs-var">mrep</span></a></span><span>
</span><span id="line-174"></span><span>                       </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Reply s u a
</span><a href="#local-6989586621679059079"><span class="hs-identifier hs-var">rep</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-175"></span><span>                         </span><span class="annot"><a href="Text.Parsec.Prim.html#Ok"><span class="hs-identifier hs-type">Ok</span></a></span><span> </span><span id="local-6989586621679059078"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679059078"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679059077"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679059077"><span class="hs-identifier hs-var">s'</span></a></span></span><span> </span><span id="local-6989586621679059076"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679059076"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679059085"><span class="hs-identifier hs-var">cok</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679059078"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679059077"><span class="hs-identifier hs-var">s'</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679059076"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-176"></span><span>                         </span><span class="annot"><a href="Text.Parsec.Prim.html#Error"><span class="hs-identifier hs-type">Error</span></a></span><span> </span><span id="local-6989586621679059075"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679059075"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679059084"><span class="hs-identifier hs-var">cerr</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679059075"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-177"></span><span>             </span><span class="annot"><a href="Text.Parsec.Prim.html#Empty"><span class="hs-identifier hs-type">Empty</span></a></span><span> </span><span id="local-6989586621679059074"><span class="annot"><span class="annottext">m (Reply s u a)
</span><a href="#local-6989586621679059074"><span class="hs-identifier hs-var">mrep</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-178"></span><span>                       </span><span id="local-6989586621679059073"><span class="annot"><span class="annottext">Reply s u a
</span><a href="#local-6989586621679059073"><span class="hs-identifier hs-var">rep</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m (Reply s u a)
</span><a href="#local-6989586621679059074"><span class="hs-identifier hs-var">mrep</span></a></span><span>
</span><span id="line-179"></span><span>                       </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Reply s u a
</span><a href="#local-6989586621679059073"><span class="hs-identifier hs-var">rep</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-180"></span><span>                         </span><span class="annot"><a href="Text.Parsec.Prim.html#Ok"><span class="hs-identifier hs-type">Ok</span></a></span><span> </span><span id="local-6989586621679059072"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679059072"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679059071"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679059071"><span class="hs-identifier hs-var">s'</span></a></span></span><span> </span><span id="local-6989586621679059070"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679059070"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679059083"><span class="hs-identifier hs-var">eok</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679059072"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679059071"><span class="hs-identifier hs-var">s'</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679059070"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-181"></span><span>                         </span><span class="annot"><a href="Text.Parsec.Prim.html#Error"><span class="hs-identifier hs-type">Error</span></a></span><span> </span><span id="local-6989586621679059069"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679059069"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679059082"><span class="hs-identifier hs-var">eerr</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679059069"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-182"></span><span>
</span><span id="line-183"></span><span class="hs-keyword">type</span><span> </span><span id="Parsec"><span class="annot"><a href="Text.Parsec.Prim.html#Parsec"><span class="hs-identifier hs-var">Parsec</span></a></span></span><span> </span><span id="local-6989586621679059068"><span class="annot"><a href="#local-6989586621679059068"><span class="hs-identifier hs-type">s</span></a></span></span><span> </span><span id="local-6989586621679059067"><span class="annot"><a href="#local-6989586621679059067"><span class="hs-identifier hs-type">u</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059068"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059067"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Identity.html#Identity"><span class="hs-identifier hs-type">Identity</span></a></span><span>
</span><span id="line-184"></span><span>
</span><span id="line-185"></span><span class="hs-keyword">data</span><span> </span><span id="Consumed"><span class="annot"><a href="Text.Parsec.Prim.html#Consumed"><span class="hs-identifier hs-var">Consumed</span></a></span></span><span> </span><span id="local-6989586621679059737"><span class="annot"><a href="#local-6989586621679059737"><span class="hs-identifier hs-type">a</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="Consumed"><span class="annot"><a href="Text.Parsec.Prim.html#Consumed"><span class="hs-identifier hs-var">Consumed</span></a></span></span><span> </span><span class="annot"><a href="#local-6989586621679059737"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-186"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span id="Empty"><span class="annot"><a href="Text.Parsec.Prim.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span></span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="#local-6989586621679059737"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-187"></span><span>    </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Typeable.Internal.html#Typeable"><span class="hs-identifier hs-type">Typeable</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-188"></span><span>
</span><span id="line-189"></span><span class="hs-keyword">data</span><span> </span><span id="Reply"><span class="annot"><a href="Text.Parsec.Prim.html#Reply"><span class="hs-identifier hs-var">Reply</span></a></span></span><span> </span><span id="local-6989586621679059789"><span class="annot"><a href="#local-6989586621679059789"><span class="hs-identifier hs-type">s</span></a></span></span><span> </span><span id="local-6989586621679059788"><span class="annot"><a href="#local-6989586621679059788"><span class="hs-identifier hs-type">u</span></a></span></span><span> </span><span id="local-6989586621679059787"><span class="annot"><a href="#local-6989586621679059787"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Ok"><span class="annot"><a href="Text.Parsec.Prim.html#Ok"><span class="hs-identifier hs-var">Ok</span></a></span></span><span> </span><span class="annot"><a href="#local-6989586621679059787"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059789"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059788"><span class="hs-identifier hs-type">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="Text.Parsec.Error.html#ParseError"><span class="hs-identifier hs-type">ParseError</span></a></span><span>
</span><span id="line-190"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span id="Error"><span class="annot"><a href="Text.Parsec.Prim.html#Error"><span class="hs-identifier hs-var">Error</span></a></span></span><span> </span><span class="annot"><a href="Text.Parsec.Error.html#ParseError"><span class="hs-identifier hs-type">ParseError</span></a></span><span>
</span><span id="line-191"></span><span>    </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Typeable.Internal.html#Typeable"><span class="hs-identifier hs-type">Typeable</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-192"></span><span>
</span><span id="line-193"></span><span class="hs-keyword">data</span><span> </span><span id="State"><span class="annot"><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-var">State</span></a></span></span><span> </span><span id="local-6989586621679059797"><span class="annot"><a href="#local-6989586621679059797"><span class="hs-identifier hs-type">s</span></a></span></span><span> </span><span id="local-6989586621679059796"><span class="annot"><a href="#local-6989586621679059796"><span class="hs-identifier hs-type">u</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="State"><span class="annot"><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-var">State</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-194"></span><span>      </span><span id="stateInput"><span class="annot"><span class="annottext">forall s u. State s u -&gt; s
</span><a href="Text.Parsec.Prim.html#stateInput"><span class="hs-identifier hs-var hs-var">stateInput</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679059797"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-195"></span><span>      </span><span id="statePos"><span class="annot"><span class="annottext">forall s u. State s u -&gt; SourcePos
</span><a href="Text.Parsec.Prim.html#statePos"><span class="hs-identifier hs-var hs-var">statePos</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-196"></span><span>      </span><span id="stateUser"><span class="annot"><span class="annottext">forall s u. State s u -&gt; u
</span><a href="Text.Parsec.Prim.html#stateUser"><span class="hs-identifier hs-var hs-var">stateUser</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="#local-6989586621679059796"><span class="hs-identifier hs-type">u</span></a></span><span>
</span><span id="line-197"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-198"></span><span>    </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Typeable.Internal.html#Typeable"><span class="hs-identifier hs-type">Typeable</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-199"></span><span>
</span><span id="line-200"></span><span class="hs-comment">-- | The 'Semigroup' instance for 'ParsecT' is used to append the result</span><span>
</span><span id="line-201"></span><span class="hs-comment">-- of several parsers, for example:</span><span>
</span><span id="line-202"></span><span class="hs-comment">--</span><span>
</span><span id="line-203"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-204"></span><span class="hs-comment">-- (many $ char 'a') &lt;&gt; (many $ char 'b')</span><span>
</span><span id="line-205"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-206"></span><span class="hs-comment">--</span><span>
</span><span id="line-207"></span><span class="hs-comment">-- The above will parse a string like @&quot;aabbb&quot;@ and return a successful</span><span>
</span><span id="line-208"></span><span class="hs-comment">-- parse result @&quot;aabbb&quot;@. Compare against the below which will</span><span>
</span><span id="line-209"></span><span class="hs-comment">-- produce a result of @&quot;bbb&quot;@ for the same input:</span><span>
</span><span id="line-210"></span><span class="hs-comment">--</span><span>
</span><span id="line-211"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-212"></span><span class="hs-comment">-- (many $ char 'a') &gt;&gt; (many $ char 'b')</span><span>
</span><span id="line-213"></span><span class="hs-comment">-- (many $ char 'a') *&gt; (many $ char 'b')</span><span>
</span><span id="line-214"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-215"></span><span class="hs-comment">--</span><span>
</span><span id="line-216"></span><span class="hs-comment">-- @since 3.1.12</span><span>
</span><span id="line-217"></span><span id="local-6989586621679059701"><span id="local-6989586621679059702"><span id="local-6989586621679059703"><span id="local-6989586621679059704"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup.Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059704"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup.Semigroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059703"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059702"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059701"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059704"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-218"></span><span>    </span><span class="hs-comment">-- | Combines two parsers like '*&gt;', '&gt;&gt;' and @do {...;...}@</span><span>
</span><span id="line-219"></span><span>    </span><span class="hs-comment">--  /but/ also combines their results with (&lt;&gt;) instead of</span><span>
</span><span id="line-220"></span><span>    </span><span class="hs-comment">--  discarding the first.</span><span>
</span><span id="line-221"></span><span>    </span><span id="local-6989586621679059055"><span class="annot"><span class="annottext">&lt;&gt; :: ParsecT s u m a -&gt; ParsecT s u m a -&gt; ParsecT s u m a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;&gt;)</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; a -&gt; a)
-&gt; ParsecT s u m a -&gt; ParsecT s u m a -&gt; ParsecT s u m a
forall (f :: * -&gt; *) a b c.
Applicative f =&gt;
(a -&gt; b -&gt; c) -&gt; f a -&gt; f b -&gt; f c
</span><a href="../../base/src/GHC.Base.html#liftA2"><span class="hs-identifier hs-var">Applicative.liftA2</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">(Semigroup.&lt;&gt;)</span></a></span><span class="hs-cpp">

#if MIN_VERSION_base(4,8,0)
</span><span>    </span><span id="local-6989586621679059048"><span class="annot"><span class="annottext">sconcat :: NonEmpty (ParsecT s u m a) -&gt; ParsecT s u m a
</span><a href="../../base/src/GHC.Base.html#sconcat"><span class="hs-identifier hs-var hs-var hs-var hs-var">sconcat</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(NonEmpty a -&gt; a) -&gt; ParsecT s u m (NonEmpty a) -&gt; ParsecT s u m a
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty a -&gt; a
forall a. Semigroup a =&gt; NonEmpty a -&gt; a
</span><a href="../../base/src/GHC.Base.html#sconcat"><span class="hs-identifier hs-var">Semigroup.sconcat</span></a></span><span> </span><span class="annot"><span class="annottext">(ParsecT s u m (NonEmpty a) -&gt; ParsecT s u m a)
-&gt; (NonEmpty (ParsecT s u m a) -&gt; ParsecT s u m (NonEmpty a))
-&gt; NonEmpty (ParsecT s u m a)
-&gt; ParsecT s u m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (ParsecT s u m a) -&gt; ParsecT s u m (NonEmpty a)
forall (t :: * -&gt; *) (m :: * -&gt; *) a.
(Traversable t, Monad m) =&gt;
t (m a) -&gt; m (t a)
</span><a href="../../base/src/Data.Traversable.html#sequence"><span class="hs-identifier hs-var">sequence</span></a></span><span class="hs-cpp">
#else
</span><span>    </span><span class="hs-identifier">sconcat</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">fmap</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Semigroup.sconcat</span><span> </span><span class="hs-operator">.</span><span> </span><span class="hs-identifier">NE.fromList</span><span class="hs-special">)</span><span> </span><span class="hs-operator">.</span><span> </span><span class="hs-identifier">sequence</span><span> </span><span class="hs-operator">.</span><span> </span><span class="hs-identifier">NE.toList</span><span class="hs-cpp">
#endif
</span><span>    </span><span id="local-6989586621679059043"><span class="annot"><span class="annottext">stimes :: forall b. Integral b =&gt; b -&gt; ParsecT s u m a -&gt; ParsecT s u m a
</span><a href="../../base/src/GHC.Base.html#stimes"><span class="hs-identifier hs-var hs-var hs-var hs-var">stimes</span></a></span></span><span> </span><span id="local-6989586621679059041"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679059041"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NonEmpty (ParsecT s u m a) -&gt; ParsecT s u m a
forall a. Semigroup a =&gt; NonEmpty a -&gt; a
</span><a href="../../base/src/GHC.Base.html#sconcat"><span class="hs-identifier hs-var">Semigroup.sconcat</span></a></span><span> </span><span class="annot"><span class="annottext">(NonEmpty (ParsecT s u m a) -&gt; ParsecT s u m a)
-&gt; (ParsecT s u m a -&gt; NonEmpty (ParsecT s u m a))
-&gt; ParsecT s u m a
-&gt; ParsecT s u m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[ParsecT s u m a] -&gt; NonEmpty (ParsecT s u m a)
forall a. [a] -&gt; NonEmpty a
</span><a href="../../base/src/Data.List.NonEmpty.html#fromList"><span class="hs-identifier hs-var">NE.fromList</span></a></span><span> </span><span class="annot"><span class="annottext">([ParsecT s u m a] -&gt; NonEmpty (ParsecT s u m a))
-&gt; (ParsecT s u m a -&gt; [ParsecT s u m a])
-&gt; ParsecT s u m a
-&gt; NonEmpty (ParsecT s u m a)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; ParsecT s u m a -&gt; [ParsecT s u m a]
forall i a. Integral i =&gt; i -&gt; a -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#genericReplicate"><span class="hs-identifier hs-var">genericReplicate</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679059041"><span class="hs-identifier hs-var">b</span></a></span></span></span></span></span><span>
</span><span id="line-229"></span><span>
</span><span id="line-230"></span><span class="hs-comment">-- | The 'Monoid' instance for 'ParsecT' is used for the same purposes as</span><span>
</span><span id="line-231"></span><span class="hs-comment">-- the 'Semigroup' instance.</span><span>
</span><span id="line-232"></span><span class="hs-comment">--</span><span>
</span><span id="line-233"></span><span class="hs-comment">-- @since 3.1.12</span><span>
</span><span id="line-234"></span><span id="local-6989586621679059669"><span id="local-6989586621679059670"><span id="local-6989586621679059671"><span id="local-6989586621679059672"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid.Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059672"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-235"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup.Semigroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059671"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059670"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059669"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059672"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-236"></span><span>         </span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid.Monoid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059671"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059670"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059669"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059672"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-237"></span><span>    </span><span class="hs-comment">-- | A parser that always succeeds, consumes no input, and</span><span>
</span><span id="line-238"></span><span>    </span><span class="hs-comment">--  returns the underlying 'Monoid''s 'mempty' value</span><span>
</span><span id="line-239"></span><span>    </span><span id="local-6989586621679059028"><span class="annot"><span class="annottext">mempty :: ParsecT s u m a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var hs-var hs-var hs-var">mempty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; ParsecT s u m a
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">Applicative.pure</span></a></span><span> </span><span class="annot"><span class="annottext">a
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">Monoid.mempty</span></a></span><span>
</span><span id="line-240"></span><span>
</span><span id="line-241"></span><span>    </span><span class="hs-comment">-- | See 'ParsecT''s 'Semigroup.&lt;&gt;' implementation</span><span>
</span><span id="line-242"></span><span>    </span><span id="local-6989586621679059026"><span class="annot"><span class="annottext">mappend :: ParsecT s u m a -&gt; ParsecT s u m a -&gt; ParsecT s u m a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var hs-var hs-var hs-var">mappend</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a -&gt; ParsecT s u m a -&gt; ParsecT s u m a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">(Semigroup.&lt;&gt;)</span></a></span><span>
</span><span id="line-243"></span><span>
</span><span id="line-244"></span><span>    </span><span id="local-6989586621679059020"><span class="annot"><span class="annottext">mconcat :: [ParsecT s u m a] -&gt; ParsecT s u m a
</span><a href="../../base/src/GHC.Base.html#mconcat"><span class="hs-identifier hs-var hs-var hs-var hs-var">mconcat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([a] -&gt; a) -&gt; ParsecT s u m [a] -&gt; ParsecT s u m a
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">Functor.fmap</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; a
forall a. Monoid a =&gt; [a] -&gt; a
</span><a href="../../base/src/GHC.Base.html#mconcat"><span class="hs-identifier hs-var">Monoid.mconcat</span></a></span><span> </span><span class="annot"><span class="annottext">(ParsecT s u m [a] -&gt; ParsecT s u m a)
-&gt; ([ParsecT s u m a] -&gt; ParsecT s u m [a])
-&gt; [ParsecT s u m a]
-&gt; ParsecT s u m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[ParsecT s u m a] -&gt; ParsecT s u m [a]
forall (t :: * -&gt; *) (m :: * -&gt; *) a.
(Traversable t, Monad m) =&gt;
t (m a) -&gt; m (t a)
</span><a href="../../base/src/Data.Traversable.html#sequence"><span class="hs-identifier hs-var">sequence</span></a></span></span></span></span></span><span>
</span><span id="line-245"></span><span>
</span><span id="line-246"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679059017"><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#Consumed"><span class="hs-identifier hs-type">Consumed</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-247"></span><span>    </span><span id="local-6989586621679059015"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; Consumed a -&gt; Consumed b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span id="local-6989586621679059014"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679059014"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#Consumed"><span class="hs-identifier hs-type">Consumed</span></a></span><span> </span><span id="local-6989586621679059013"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679059013"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; Consumed b
forall a. a -&gt; Consumed a
</span><a href="Text.Parsec.Prim.html#Consumed"><span class="hs-identifier hs-var">Consumed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679059014"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679059013"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-248"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span id="local-6989586621679059012"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679059012"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#Empty"><span class="hs-identifier hs-type">Empty</span></a></span><span> </span><span id="local-6989586621679059011"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679059011"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; Consumed b
forall a. a -&gt; Consumed a
</span><a href="Text.Parsec.Prim.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679059012"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679059011"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-249"></span><span>
</span><span id="line-250"></span><span id="local-6989586621679059662"><span id="local-6989586621679059663"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679059008"><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#Reply"><span class="hs-identifier hs-type">Reply</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059663"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059662"><span class="hs-identifier hs-type">u</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-251"></span><span>    </span><span id="local-6989586621679059007"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; Reply s u a -&gt; Reply s u b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span id="local-6989586621679059006"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679059006"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#Ok"><span class="hs-identifier hs-type">Ok</span></a></span><span> </span><span id="local-6989586621679059005"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679059005"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679059004"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679059004"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679059003"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679059003"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; State s u -&gt; ParseError -&gt; Reply s u b
forall s u a. a -&gt; State s u -&gt; ParseError -&gt; Reply s u a
</span><a href="Text.Parsec.Prim.html#Ok"><span class="hs-identifier hs-var">Ok</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679059006"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679059005"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679059004"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679059003"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-252"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#Error"><span class="hs-identifier hs-type">Error</span></a></span><span> </span><span id="local-6989586621679059002"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679059002"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; Reply s u b
forall s u a. ParseError -&gt; Reply s u a
</span><a href="Text.Parsec.Prim.html#Error"><span class="hs-identifier hs-var">Error</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679059002"><span class="hs-identifier hs-var">e</span></a></span></span></span><span> </span><span class="hs-comment">-- XXX</span><span>
</span><span id="line-253"></span><span>
</span><span id="line-254"></span><span id="local-6989586621679059691"><span id="local-6989586621679059692"><span id="local-6989586621679059693"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679058999"><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059693"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059692"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059691"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-255"></span><span>    </span><span id="local-6989586621679058998"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; ParsecT s u m a -&gt; ParsecT s u m b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span id="local-6989586621679058997"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679058997"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679058996"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058996"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; ParsecT s u m a -&gt; ParsecT s u m b
forall a b s u (m :: * -&gt; *).
(a -&gt; b) -&gt; ParsecT s u m a -&gt; ParsecT s u m b
</span><a href="Text.Parsec.Prim.html#parsecMap"><span class="hs-identifier hs-var">parsecMap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679058997"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058996"><span class="hs-identifier hs-var">p</span></a></span></span></span></span><span>
</span><span id="line-256"></span><span>
</span><span id="line-257"></span><span id="local-6989586621679059653"><span id="local-6989586621679059654"><span id="local-6989586621679059655"><span id="local-6989586621679059656"><span id="local-6989586621679059657"><span class="annot"><a href="Text.Parsec.Prim.html#parsecMap"><span class="hs-identifier hs-type">parsecMap</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059657"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059656"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059655"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059654"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059653"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059657"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059655"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059654"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059653"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059656"><span class="hs-identifier hs-type">b</span></a></span></span></span></span></span></span><span>
</span><span id="line-258"></span><span id="parsecMap"><span class="annot"><span class="annottext">parsecMap :: forall a b s u (m :: * -&gt; *).
(a -&gt; b) -&gt; ParsecT s u m a -&gt; ParsecT s u m b
</span><a href="Text.Parsec.Prim.html#parsecMap"><span class="hs-identifier hs-var hs-var">parsecMap</span></a></span></span><span> </span><span id="local-6989586621679058995"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679058995"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679058994"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058994"><span class="hs-identifier hs-var">p</span></a></span></span><span>
</span><span id="line-259"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall b.
 State s u
 -&gt; (b -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (b -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m b
forall s u (m :: * -&gt; *) a.
(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-var">ParsecT</span></a></span><span> </span><span class="annot"><span class="annottext">((forall b.
  State s u
  -&gt; (b -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; (b -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; m b)
 -&gt; ParsecT s u m b)
-&gt; (forall b.
    State s u
    -&gt; (b -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; (b -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; m b)
-&gt; ParsecT s u m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679058993"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058993"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679058992"><span class="annot"><span class="annottext">b -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058992"><span class="hs-identifier hs-var">cok</span></a></span></span><span> </span><span id="local-6989586621679058991"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058991"><span class="hs-identifier hs-var">cerr</span></a></span></span><span> </span><span id="local-6989586621679058990"><span class="annot"><span class="annottext">b -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058990"><span class="hs-identifier hs-var">eok</span></a></span></span><span> </span><span id="local-6989586621679058989"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058989"><span class="hs-identifier hs-var">eerr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-260"></span><span>      </span><span class="annot"><span class="annottext">ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
forall s u (m :: * -&gt; *) a.
ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
</span><a href="Text.Parsec.Prim.html#unParser"><span class="hs-identifier hs-var hs-var">unParser</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058994"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058993"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058992"><span class="hs-identifier hs-var">cok</span></a></span><span> </span><span class="annot"><span class="annottext">(b -&gt; State s u -&gt; ParseError -&gt; m b)
-&gt; (a -&gt; b) -&gt; a -&gt; State s u -&gt; ParseError -&gt; m b
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679058995"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058991"><span class="hs-identifier hs-var">cerr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058990"><span class="hs-identifier hs-var">eok</span></a></span><span> </span><span class="annot"><span class="annottext">(b -&gt; State s u -&gt; ParseError -&gt; m b)
-&gt; (a -&gt; b) -&gt; a -&gt; State s u -&gt; ParseError -&gt; m b
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679058995"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058989"><span class="hs-identifier hs-var">eerr</span></a></span><span>
</span><span id="line-261"></span><span>
</span><span id="line-262"></span><span id="local-6989586621679059698"><span id="local-6989586621679059699"><span id="local-6989586621679059700"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679058983"><span class="annot"><a href="../../base/src/GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative.Applicative</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059700"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059699"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059698"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-263"></span><span>    </span><span id="local-6989586621679058979"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; ParsecT s u m a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; ParsecT s u m a
forall a s u (m :: * -&gt; *). a -&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#parserReturn"><span class="hs-identifier hs-var">parserReturn</span></a></span><span>
</span><span id="line-264"></span><span>    </span><span id="local-6989586621679058977"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b.
ParsecT s u m (a -&gt; b) -&gt; ParsecT s u m a -&gt; ParsecT s u m b
</span><a href="../../base/src/GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;*&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m (a -&gt; b) -&gt; ParsecT s u m a -&gt; ParsecT s u m b
forall (m :: * -&gt; *) a b. Monad m =&gt; m (a -&gt; b) -&gt; m a -&gt; m b
</span><a href="../../base/src/GHC.Base.html#ap"><span class="hs-identifier hs-var">ap</span></a></span><span> </span><span class="hs-comment">-- TODO: Can this be optimized?</span><span>
</span><span id="line-265"></span><span>    </span><span id="local-6989586621679058975"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058975"><span class="hs-identifier hs-var">p1</span></a></span></span><span> </span><span id="local-6989586621679058974"><span class="annot"><span class="annottext">*&gt; :: forall a b. ParsecT s u m a -&gt; ParsecT s u m b -&gt; ParsecT s u m b
</span><a href="../../base/src/GHC.Base.html#%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">*&gt;</span></a></span></span><span> </span><span id="local-6989586621679058973"><span class="annot"><span class="annottext">ParsecT s u m b
</span><a href="#local-6989586621679058973"><span class="hs-identifier hs-var">p2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058975"><span class="hs-identifier hs-var">p1</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a -&gt; (a -&gt; ParsecT s u m b) -&gt; ParsecT s u m b
forall s u (m :: * -&gt; *) a b.
ParsecT s u m a -&gt; (a -&gt; ParsecT s u m b) -&gt; ParsecT s u m b
</span><a href="Text.Parsec.Prim.html#parserBind"><span class="hs-operator hs-var">`parserBind`</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m b -&gt; a -&gt; ParsecT s u m b
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m b
</span><a href="#local-6989586621679058973"><span class="hs-identifier hs-var">p2</span></a></span><span>
</span><span id="line-266"></span><span>    </span><span id="local-6989586621679058967"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058967"><span class="hs-identifier hs-var">p1</span></a></span></span><span> </span><span id="local-6989586621679058966"><span class="annot"><span class="annottext">&lt;* :: forall a b. ParsecT s u m a -&gt; ParsecT s u m b -&gt; ParsecT s u m a
</span><a href="../../base/src/GHC.Base.html#%3C%2A"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;*</span></a></span></span><span> </span><span id="local-6989586621679058964"><span class="annot"><span class="annottext">ParsecT s u m b
</span><a href="#local-6989586621679058964"><span class="hs-identifier hs-var">p2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621679058963"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058963"><span class="hs-identifier hs-var">x1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058967"><span class="hs-identifier hs-var">p1</span></a></span><span> </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m b -&gt; ParsecT s u m ()
forall (f :: * -&gt; *) a. Functor f =&gt; f a -&gt; f ()
</span><a href="../../base/src/Data.Functor.html#void"><span class="hs-identifier hs-var">void</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m b
</span><a href="#local-6989586621679058964"><span class="hs-identifier hs-var">p2</span></a></span><span> </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">a -&gt; ParsecT s u m a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058963"><span class="hs-identifier hs-var">x1</span></a></span><span> </span><span class="hs-special">}</span></span></span></span><span>
</span><span id="line-267"></span><span>
</span><span id="line-268"></span><span id="local-6989586621679059611"><span id="local-6989586621679059612"><span id="local-6989586621679059613"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679058954"><span id="local-6989586621679058956"><span class="annot"><a href="../../base/src/GHC.Base.html#Alternative"><span class="hs-identifier hs-type">Applicative.Alternative</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059613"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059612"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059611"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-269"></span><span>    </span><span id="local-6989586621679058950"><span class="annot"><span class="annottext">empty :: forall a. ParsecT s u m a
</span><a href="../../base/src/GHC.Base.html#empty"><span class="hs-identifier hs-var hs-var hs-var hs-var">empty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
forall (m :: * -&gt; *) a. MonadPlus m =&gt; m a
</span><a href="../../base/src/GHC.Base.html#mzero"><span class="hs-identifier hs-var">mzero</span></a></span><span>
</span><span id="line-270"></span><span>    </span><span id="local-6989586621679058946"><span class="annot"><span class="annottext">&lt;|&gt; :: forall a. ParsecT s u m a -&gt; ParsecT s u m a -&gt; ParsecT s u m a
</span><a href="../../base/src/GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;|&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a -&gt; ParsecT s u m a -&gt; ParsecT s u m a
forall (m :: * -&gt; *) a. MonadPlus m =&gt; m a -&gt; m a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#mplus"><span class="hs-identifier hs-var">mplus</span></a></span></span></span></span><span>
</span><span id="line-271"></span><span>
</span><span id="line-272"></span><span id="local-6989586621679059688"><span id="local-6989586621679059689"><span id="local-6989586621679059690"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059690"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059689"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059688"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-273"></span><span>    </span><span id="local-6989586621679058936"><span class="annot"><span class="annottext">return :: forall a. a -&gt; ParsecT s u m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var hs-var hs-var hs-var">return</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; ParsecT s u m a
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">Applicative.pure</span></a></span><span>
</span><span id="line-274"></span><span>    </span><span id="local-6989586621679058935"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058935"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679058934"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b.
ParsecT s u m a -&gt; (a -&gt; ParsecT s u m b) -&gt; ParsecT s u m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">&gt;&gt;=</span></a></span></span><span> </span><span id="local-6989586621679058933"><span class="annot"><span class="annottext">a -&gt; ParsecT s u m b
</span><a href="#local-6989586621679058933"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a -&gt; (a -&gt; ParsecT s u m b) -&gt; ParsecT s u m b
forall s u (m :: * -&gt; *) a b.
ParsecT s u m a -&gt; (a -&gt; ParsecT s u m b) -&gt; ParsecT s u m b
</span><a href="Text.Parsec.Prim.html#parserBind"><span class="hs-identifier hs-var">parserBind</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058935"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; ParsecT s u m b
</span><a href="#local-6989586621679058933"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-275"></span><span>    </span><span id="local-6989586621679058931"><span class="annot"><span class="annottext">&gt;&gt; :: forall a b. ParsecT s u m a -&gt; ParsecT s u m b -&gt; ParsecT s u m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&gt;&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a -&gt; ParsecT s u m b -&gt; ParsecT s u m b
forall (f :: * -&gt; *) a b. Applicative f =&gt; f a -&gt; f b -&gt; f b
</span><a href="../../base/src/GHC.Base.html#%2A%3E"><span class="hs-operator hs-var">(Applicative.*&gt;)</span></a></span></span></span></span><span class="hs-cpp">
#if !MIN_VERSION_base(4,13,0)
</span><span>    </span><span class="hs-identifier">fail</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">Fail.fail</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-280"></span><span class="hs-comment">-- | @since 3.1.12.0</span><span>
</span><span id="line-281"></span><span id="local-6989586621679059582"><span id="local-6989586621679059583"><span id="local-6989586621679059584"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.Fail.html#MonadFail"><span class="hs-identifier hs-type">Fail.MonadFail</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059584"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059583"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059582"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-282"></span><span>    </span><span id="local-6989586621679058925"><span class="annot"><span class="annottext">fail :: forall a. String -&gt; ParsecT s u m a
</span><a href="../../base/src/Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var hs-var hs-var hs-var">fail</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ParsecT s u m a
forall s u (m :: * -&gt; *) a. String -&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#parserFail"><span class="hs-identifier hs-var">parserFail</span></a></span></span></span></span><span>
</span><span id="line-283"></span><span>
</span><span id="line-284"></span><span id="local-6989586621679059572"><span id="local-6989586621679059573"><span id="local-6989586621679059574"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059574"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059573"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059572"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059574"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-285"></span><span>    </span><span id="local-6989586621679058912"><span class="annot"><span class="annottext">liftIO :: forall a. IO a -&gt; ParsecT s u m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var hs-var hs-var hs-var">liftIO</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; ParsecT s u m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><span class="hs-identifier hs-var">lift</span></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; ParsecT s u m a)
-&gt; (IO a -&gt; m a) -&gt; IO a -&gt; ParsecT s u m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">IO a -&gt; m a
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span></span></span></span><span>
</span><span id="line-286"></span><span>
</span><span id="line-287"></span><span id="local-6989586621679059557"><span id="local-6989586621679059558"><span id="local-6989586621679059559"><span id="local-6989586621679059560"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679058904"><span class="hs-special">(</span><span class="annot"><a href="../../mtl/src/Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059560"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059559"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../mtl/src/Control.Monad.Reader.Class.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059560"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059558"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059557"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059559"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-288"></span><span>    </span><span id="local-6989586621679058899"><span class="annot"><span class="annottext">ask :: ParsecT s u m r
</span><a href="../../mtl/src/Control.Monad.Reader.Class.html#ask"><span class="hs-identifier hs-var hs-var hs-var hs-var">ask</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m r -&gt; ParsecT s u m r
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><span class="hs-identifier hs-var">lift</span></span><span> </span><span class="annot"><span class="annottext">m r
forall r (m :: * -&gt; *). MonadReader r m =&gt; m r
</span><a href="../../mtl/src/Control.Monad.Reader.Class.html#ask"><span class="hs-identifier hs-var">ask</span></a></span><span>
</span><span id="line-289"></span><span>    </span><span id="local-6989586621679058894"><span class="annot"><span class="annottext">local :: forall a. (r -&gt; r) -&gt; ParsecT s u m a -&gt; ParsecT s u m a
</span><a href="../../mtl/src/Control.Monad.Reader.Class.html#local"><span class="hs-identifier hs-var hs-var hs-var hs-var">local</span></a></span></span><span> </span><span id="local-6989586621679058892"><span class="annot"><span class="annottext">r -&gt; r
</span><a href="#local-6989586621679058892"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679058891"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058891"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State s u -&gt; m (Consumed (m (Reply s u a)))) -&gt; ParsecT s u m a
forall (m :: * -&gt; *) s u a.
Monad m =&gt;
(State s u -&gt; m (Consumed (m (Reply s u a)))) -&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#mkPT"><span class="hs-identifier hs-var">mkPT</span></a></span><span> </span><span class="annot"><span class="annottext">((State s u -&gt; m (Consumed (m (Reply s u a)))) -&gt; ParsecT s u m a)
-&gt; (State s u -&gt; m (Consumed (m (Reply s u a)))) -&gt; ParsecT s u m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679058890"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058890"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(r -&gt; r)
-&gt; m (Consumed (m (Reply s u a))) -&gt; m (Consumed (m (Reply s u a)))
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; r) -&gt; m a -&gt; m a
</span><a href="../../mtl/src/Control.Monad.Reader.Class.html#local"><span class="hs-identifier hs-var">local</span></a></span><span> </span><span class="annot"><span class="annottext">r -&gt; r
</span><a href="#local-6989586621679058892"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ParsecT s u m a -&gt; State s u -&gt; m (Consumed (m (Reply s u a)))
forall (m :: * -&gt; *) s u a.
Monad m =&gt;
ParsecT s u m a -&gt; State s u -&gt; m (Consumed (m (Reply s u a)))
</span><a href="Text.Parsec.Prim.html#runParsecT"><span class="hs-identifier hs-var">runParsecT</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058891"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058890"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span></span></span></span></span><span>
</span><span id="line-290"></span><span>
</span><span id="line-291"></span><span class="hs-comment">-- I'm presuming the user might want a separate, non-backtracking</span><span>
</span><span id="line-292"></span><span class="hs-comment">-- state aside from the Parsec user state.</span><span>
</span><span id="line-293"></span><span id="local-6989586621679059549"><span id="local-6989586621679059550"><span id="local-6989586621679059551"><span id="local-6989586621679059552"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679058884"><span class="hs-special">(</span><span class="annot"><a href="../../mtl/src/Control.Monad.State.Class.html#MonadState"><span class="hs-identifier hs-type">MonadState</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059552"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059551"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../mtl/src/Control.Monad.State.Class.html#MonadState"><span class="hs-identifier hs-type">MonadState</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059552"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059550"><span class="hs-identifier hs-type">s'</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059549"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059551"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-294"></span><span>    </span><span id="local-6989586621679058879"><span class="annot"><span class="annottext">get :: ParsecT s' u m s
</span><a href="../../mtl/src/Control.Monad.State.Class.html#get"><span class="hs-identifier hs-var hs-var hs-var hs-var">get</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m s -&gt; ParsecT s' u m s
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><span class="hs-identifier hs-var">lift</span></span><span> </span><span class="annot"><span class="annottext">m s
forall s (m :: * -&gt; *). MonadState s m =&gt; m s
</span><a href="../../mtl/src/Control.Monad.State.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-295"></span><span>    </span><span id="local-6989586621679058874"><span class="annot"><span class="annottext">put :: s -&gt; ParsecT s' u m ()
</span><a href="../../mtl/src/Control.Monad.State.Class.html#put"><span class="hs-identifier hs-var hs-var hs-var hs-var">put</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m () -&gt; ParsecT s' u m ()
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><span class="hs-identifier hs-var">lift</span></span><span> </span><span class="annot"><span class="annottext">(m () -&gt; ParsecT s' u m ())
-&gt; (s -&gt; m ()) -&gt; s -&gt; ParsecT s' u m ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">s -&gt; m ()
forall s (m :: * -&gt; *). MonadState s m =&gt; s -&gt; m ()
</span><a href="../../mtl/src/Control.Monad.State.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span></span></span></span></span><span>
</span><span id="line-296"></span><span>
</span><span id="line-297"></span><span id="local-6989586621679059539"><span id="local-6989586621679059540"><span id="local-6989586621679059541"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../mtl/src/Control.Monad.Cont.Class.html#MonadCont"><span class="hs-identifier hs-type">MonadCont</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059541"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../mtl/src/Control.Monad.Cont.Class.html#MonadCont"><span class="hs-identifier hs-type">MonadCont</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059540"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059539"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059541"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-298"></span><span>    </span><span id="local-6989586621679058859"><span class="annot"><span class="annottext">callCC :: forall a b.
((a -&gt; ParsecT s u m b) -&gt; ParsecT s u m a) -&gt; ParsecT s u m a
</span><a href="../../mtl/src/Control.Monad.Cont.Class.html#callCC"><span class="hs-identifier hs-var hs-var hs-var hs-var">callCC</span></a></span></span><span> </span><span id="local-6989586621679058857"><span class="annot"><span class="annottext">(a -&gt; ParsecT s u m b) -&gt; ParsecT s u m a
</span><a href="#local-6989586621679058857"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State s u -&gt; m (Consumed (m (Reply s u a)))) -&gt; ParsecT s u m a
forall (m :: * -&gt; *) s u a.
Monad m =&gt;
(State s u -&gt; m (Consumed (m (Reply s u a)))) -&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#mkPT"><span class="hs-identifier hs-var">mkPT</span></a></span><span> </span><span class="annot"><span class="annottext">((State s u -&gt; m (Consumed (m (Reply s u a)))) -&gt; ParsecT s u m a)
-&gt; (State s u -&gt; m (Consumed (m (Reply s u a)))) -&gt; ParsecT s u m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679058856"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058856"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-299"></span><span>          </span><span class="annot"><span class="annottext">((Consumed (m (Reply s u a)) -&gt; m (Consumed (m (Reply s u b))))
 -&gt; m (Consumed (m (Reply s u a))))
-&gt; m (Consumed (m (Reply s u a)))
forall (m :: * -&gt; *) a b. MonadCont m =&gt; ((a -&gt; m b) -&gt; m a) -&gt; m a
</span><a href="../../mtl/src/Control.Monad.Cont.Class.html#callCC"><span class="hs-identifier hs-var">callCC</span></a></span><span> </span><span class="annot"><span class="annottext">(((Consumed (m (Reply s u a)) -&gt; m (Consumed (m (Reply s u b))))
  -&gt; m (Consumed (m (Reply s u a))))
 -&gt; m (Consumed (m (Reply s u a))))
-&gt; ((Consumed (m (Reply s u a)) -&gt; m (Consumed (m (Reply s u b))))
    -&gt; m (Consumed (m (Reply s u a))))
-&gt; m (Consumed (m (Reply s u a)))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679058855"><span class="annot"><span class="annottext">Consumed (m (Reply s u a)) -&gt; m (Consumed (m (Reply s u b)))
</span><a href="#local-6989586621679058855"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-300"></span><span>          </span><span class="annot"><span class="annottext">ParsecT s u m a -&gt; State s u -&gt; m (Consumed (m (Reply s u a)))
forall (m :: * -&gt; *) s u a.
Monad m =&gt;
ParsecT s u m a -&gt; State s u -&gt; m (Consumed (m (Reply s u a)))
</span><a href="Text.Parsec.Prim.html#runParsecT"><span class="hs-identifier hs-var">runParsecT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; ParsecT s u m b) -&gt; ParsecT s u m a
</span><a href="#local-6989586621679058857"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679058854"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058854"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(State s u -&gt; m (Consumed (m (Reply s u b)))) -&gt; ParsecT s u m b
forall (m :: * -&gt; *) s u a.
Monad m =&gt;
(State s u -&gt; m (Consumed (m (Reply s u a)))) -&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#mkPT"><span class="hs-identifier hs-var">mkPT</span></a></span><span> </span><span class="annot"><span class="annottext">((State s u -&gt; m (Consumed (m (Reply s u b)))) -&gt; ParsecT s u m b)
-&gt; (State s u -&gt; m (Consumed (m (Reply s u b)))) -&gt; ParsecT s u m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679058853"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058853"><span class="hs-identifier hs-var">s'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Consumed (m (Reply s u a)) -&gt; m (Consumed (m (Reply s u b)))
</span><a href="#local-6989586621679058855"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">State s u -&gt; a -&gt; Consumed (m (Reply s u a))
forall {m :: * -&gt; *} {s} {u} {a}.
Monad m =&gt;
State s u -&gt; a -&gt; Consumed (m (Reply s u a))
</span><a href="#local-6989586621679058852"><span class="hs-identifier hs-var">pack</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058853"><span class="hs-identifier hs-var">s'</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058854"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058856"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-301"></span><span>
</span><span id="line-302"></span><span>     </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679058852"><span class="annot"><span class="annottext">pack :: State s u -&gt; a -&gt; Consumed (m (Reply s u a))
</span><a href="#local-6989586621679058852"><span class="hs-identifier hs-var hs-var">pack</span></a></span></span><span> </span><span id="local-6989586621679058849"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058849"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679058848"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058848"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Reply s u a) -&gt; Consumed (m (Reply s u a))
forall a. a -&gt; Consumed a
</span><a href="Text.Parsec.Prim.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Reply s u a) -&gt; Consumed (m (Reply s u a)))
-&gt; m (Reply s u a) -&gt; Consumed (m (Reply s u a))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Reply s u a -&gt; m (Reply s u a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; Reply s u a
forall s u a. a -&gt; State s u -&gt; ParseError -&gt; Reply s u a
</span><a href="Text.Parsec.Prim.html#Ok"><span class="hs-identifier hs-var">Ok</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058848"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058849"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">State s u -&gt; ParseError
forall s u. State s u -&gt; ParseError
</span><a href="Text.Parsec.Prim.html#unknownError"><span class="hs-identifier hs-var">unknownError</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058849"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-303"></span><span>
</span><span id="line-304"></span><span id="local-6989586621679059520"><span id="local-6989586621679059521"><span id="local-6989586621679059522"><span id="local-6989586621679059523"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../mtl/src/Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059523"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059522"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../mtl/src/Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059523"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059521"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059520"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059522"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-305"></span><span>    </span><span id="local-6989586621679058835"><span class="annot"><span class="annottext">throwError :: forall a. e -&gt; ParsecT s u m a
</span><a href="../../mtl/src/Control.Monad.Error.Class.html#throwError"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; ParsecT s u m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><span class="hs-identifier hs-var">lift</span></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; ParsecT s u m a) -&gt; (e -&gt; m a) -&gt; e -&gt; ParsecT s u m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall e (m :: * -&gt; *) a. MonadError e m =&gt; e -&gt; m a
</span><a href="../../mtl/src/Control.Monad.Error.Class.html#throwError"><span class="hs-identifier hs-var">throwError</span></a></span><span>
</span><span id="line-306"></span><span>    </span><span id="local-6989586621679058829"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058829"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679058828"><span class="annot"><span class="annottext">catchError :: forall a.
ParsecT s u m a -&gt; (e -&gt; ParsecT s u m a) -&gt; ParsecT s u m a
</span><a href="../../mtl/src/Control.Monad.Error.Class.html#catchError"><span class="hs-operator hs-var hs-var hs-var hs-var">`catchError`</span></a></span></span><span> </span><span id="local-6989586621679058826"><span class="annot"><span class="annottext">e -&gt; ParsecT s u m a
</span><a href="#local-6989586621679058826"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State s u -&gt; m (Consumed (m (Reply s u a)))) -&gt; ParsecT s u m a
forall (m :: * -&gt; *) s u a.
Monad m =&gt;
(State s u -&gt; m (Consumed (m (Reply s u a)))) -&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#mkPT"><span class="hs-identifier hs-var">mkPT</span></a></span><span> </span><span class="annot"><span class="annottext">((State s u -&gt; m (Consumed (m (Reply s u a)))) -&gt; ParsecT s u m a)
-&gt; (State s u -&gt; m (Consumed (m (Reply s u a)))) -&gt; ParsecT s u m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679058825"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058825"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-307"></span><span>        </span><span class="annot"><span class="annottext">ParsecT s u m a -&gt; State s u -&gt; m (Consumed (m (Reply s u a)))
forall (m :: * -&gt; *) s u a.
Monad m =&gt;
ParsecT s u m a -&gt; State s u -&gt; m (Consumed (m (Reply s u a)))
</span><a href="Text.Parsec.Prim.html#runParsecT"><span class="hs-identifier hs-var">runParsecT</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058829"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058825"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">m (Consumed (m (Reply s u a)))
-&gt; (e -&gt; m (Consumed (m (Reply s u a))))
-&gt; m (Consumed (m (Reply s u a)))
forall e (m :: * -&gt; *) a.
MonadError e m =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="../../mtl/src/Control.Monad.Error.Class.html#catchError"><span class="hs-operator hs-var">`catchError`</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679058824"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679058824"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-308"></span><span>            </span><span class="annot"><span class="annottext">ParsecT s u m a -&gt; State s u -&gt; m (Consumed (m (Reply s u a)))
forall (m :: * -&gt; *) s u a.
Monad m =&gt;
ParsecT s u m a -&gt; State s u -&gt; m (Consumed (m (Reply s u a)))
</span><a href="Text.Parsec.Prim.html#runParsecT"><span class="hs-identifier hs-var">runParsecT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e -&gt; ParsecT s u m a
</span><a href="#local-6989586621679058826"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679058824"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058825"><span class="hs-identifier hs-var">s</span></a></span></span></span></span></span><span>
</span><span id="line-309"></span><span>
</span><span id="line-310"></span><span id="local-6989586621679059636"><span id="local-6989586621679059637"><span id="local-6989586621679059638"><span id="local-6989586621679059639"><span class="annot"><a href="Text.Parsec.Prim.html#parserReturn"><span class="hs-identifier hs-type">parserReturn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679059639"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059638"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059637"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059636"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059639"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span><span>
</span><span id="line-311"></span><span id="parserReturn"><span class="annot"><span class="annottext">parserReturn :: forall a s u (m :: * -&gt; *). a -&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#parserReturn"><span class="hs-identifier hs-var hs-var">parserReturn</span></a></span></span><span> </span><span id="local-6989586621679058823"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058823"><span class="hs-identifier hs-var">x</span></a></span></span><span>
</span><span id="line-312"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
forall s u (m :: * -&gt; *) a.
(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-var">ParsecT</span></a></span><span> </span><span class="annot"><span class="annottext">((forall b.
  State s u
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; m b)
 -&gt; ParsecT s u m a)
-&gt; (forall b.
    State s u
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; m b)
-&gt; ParsecT s u m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679058822"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058822"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679058821"><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058821"><span class="hs-identifier hs-var">eok</span></a></span></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-313"></span><span>      </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058821"><span class="hs-identifier hs-var">eok</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058823"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058822"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">State s u -&gt; ParseError
forall s u. State s u -&gt; ParseError
</span><a href="Text.Parsec.Prim.html#unknownError"><span class="hs-identifier hs-var">unknownError</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058822"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-314"></span><span>
</span><span id="line-315"></span><span id="local-6989586621679059624"><span id="local-6989586621679059625"><span id="local-6989586621679059626"><span id="local-6989586621679059627"><span id="local-6989586621679059628"><span class="annot"><a href="Text.Parsec.Prim.html#parserBind"><span class="hs-identifier hs-type">parserBind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059628"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059627"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059626"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059625"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059625"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059628"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059627"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059626"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059624"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059628"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059627"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059626"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059624"><span class="hs-identifier hs-type">b</span></a></span></span></span></span></span></span><span>
</span><span id="line-316"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#parserBind"><span class="hs-pragma hs-type">parserBind</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-317"></span><span id="parserBind"><span class="annot"><span class="annottext">parserBind :: forall s u (m :: * -&gt; *) a b.
ParsecT s u m a -&gt; (a -&gt; ParsecT s u m b) -&gt; ParsecT s u m b
</span><a href="Text.Parsec.Prim.html#parserBind"><span class="hs-identifier hs-var hs-var">parserBind</span></a></span></span><span> </span><span id="local-6989586621679058820"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058820"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679058819"><span class="annot"><span class="annottext">a -&gt; ParsecT s u m b
</span><a href="#local-6989586621679058819"><span class="hs-identifier hs-var">k</span></a></span></span><span>
</span><span id="line-318"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall b.
 State s u
 -&gt; (b -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (b -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m b
forall s u (m :: * -&gt; *) a.
(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-var">ParsecT</span></a></span><span> </span><span class="annot"><span class="annottext">((forall b.
  State s u
  -&gt; (b -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; (b -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; m b)
 -&gt; ParsecT s u m b)
-&gt; (forall b.
    State s u
    -&gt; (b -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; (b -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; m b)
-&gt; ParsecT s u m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679058818"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058818"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679058817"><span class="annot"><span class="annottext">b -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058817"><span class="hs-identifier hs-var">cok</span></a></span></span><span> </span><span id="local-6989586621679058816"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058816"><span class="hs-identifier hs-var">cerr</span></a></span></span><span> </span><span id="local-6989586621679058815"><span class="annot"><span class="annottext">b -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058815"><span class="hs-identifier hs-var">eok</span></a></span></span><span> </span><span id="local-6989586621679058814"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058814"><span class="hs-identifier hs-var">eerr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-319"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-320"></span><span>        </span><span class="hs-comment">-- consumed-okay case for m</span><span>
</span><span id="line-321"></span><span>        </span><span id="local-6989586621679058813"><span class="annot"><span class="annottext">mcok :: a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058813"><span class="hs-identifier hs-var hs-var">mcok</span></a></span></span><span> </span><span id="local-6989586621679058812"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058812"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679058811"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058811"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679058810"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058810"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-322"></span><span>            </span><span class="hs-keyword">let</span><span>
</span><span id="line-323"></span><span>                 </span><span class="hs-comment">-- if (k x) consumes, those go straigt up</span><span>
</span><span id="line-324"></span><span>                 </span><span id="local-6989586621679058809"><span class="annot"><span class="annottext">pcok :: b -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058809"><span class="hs-identifier hs-var hs-var">pcok</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058817"><span class="hs-identifier hs-var">cok</span></a></span><span>
</span><span id="line-325"></span><span>                 </span><span id="local-6989586621679058808"><span class="annot"><span class="annottext">pcerr :: ParseError -&gt; m b
</span><a href="#local-6989586621679058808"><span class="hs-identifier hs-var hs-var">pcerr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058816"><span class="hs-identifier hs-var">cerr</span></a></span><span>
</span><span id="line-326"></span><span>
</span><span id="line-327"></span><span>                 </span><span class="hs-comment">-- if (k x) doesn't consume input, but is okay,</span><span>
</span><span id="line-328"></span><span>                 </span><span class="hs-comment">-- we still return in the consumed continuation</span><span>
</span><span id="line-329"></span><span>                 </span><span id="local-6989586621679058807"><span class="annot"><span class="annottext">peok :: b -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058807"><span class="hs-identifier hs-var hs-var">peok</span></a></span></span><span> </span><span id="local-6989586621679058806"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679058806"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679058805"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058805"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679058804"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058804"><span class="hs-identifier hs-var">err'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058817"><span class="hs-identifier hs-var">cok</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679058806"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058805"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ParseError -&gt; ParseError -&gt; ParseError
</span><a href="Text.Parsec.Error.html#mergeError"><span class="hs-identifier hs-var">mergeError</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058810"><span class="hs-identifier hs-var">err</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058804"><span class="hs-identifier hs-var">err'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-330"></span><span>
</span><span id="line-331"></span><span>                 </span><span class="hs-comment">-- if (k x) doesn't consume input, but errors,</span><span>
</span><span id="line-332"></span><span>                 </span><span class="hs-comment">-- we return the error in the 'consumed-error'</span><span>
</span><span id="line-333"></span><span>                 </span><span class="hs-comment">-- continuation</span><span>
</span><span id="line-334"></span><span>                 </span><span id="local-6989586621679058802"><span class="annot"><span class="annottext">peerr :: ParseError -&gt; m b
</span><a href="#local-6989586621679058802"><span class="hs-identifier hs-var hs-var">peerr</span></a></span></span><span> </span><span id="local-6989586621679058801"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058801"><span class="hs-identifier hs-var">err'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058816"><span class="hs-identifier hs-var">cerr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ParseError -&gt; ParseError -&gt; ParseError
</span><a href="Text.Parsec.Error.html#mergeError"><span class="hs-identifier hs-var">mergeError</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058810"><span class="hs-identifier hs-var">err</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058801"><span class="hs-identifier hs-var">err'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-335"></span><span>            </span><span class="hs-keyword">in</span><span>  </span><span class="annot"><span class="annottext">ParsecT s u m b
-&gt; forall b.
   State s u
   -&gt; (b -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (b -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
forall s u (m :: * -&gt; *) a.
ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
</span><a href="Text.Parsec.Prim.html#unParser"><span class="hs-identifier hs-var hs-var">unParser</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ParsecT s u m b
</span><a href="#local-6989586621679058819"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058812"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058811"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058809"><span class="hs-identifier hs-var">pcok</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058808"><span class="hs-identifier hs-var">pcerr</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058807"><span class="hs-identifier hs-var">peok</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058802"><span class="hs-identifier hs-var">peerr</span></a></span><span>
</span><span id="line-336"></span><span>
</span><span id="line-337"></span><span>        </span><span class="hs-comment">-- empty-ok case for m</span><span>
</span><span id="line-338"></span><span>        </span><span id="local-6989586621679058800"><span class="annot"><span class="annottext">meok :: a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058800"><span class="hs-identifier hs-var hs-var">meok</span></a></span></span><span> </span><span id="local-6989586621679058799"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058799"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679058798"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058798"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679058797"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058797"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-339"></span><span>            </span><span class="hs-keyword">let</span><span>
</span><span id="line-340"></span><span>                </span><span class="hs-comment">-- in these cases, (k x) can return as empty</span><span>
</span><span id="line-341"></span><span>                </span><span id="local-6989586621679058796"><span class="annot"><span class="annottext">pcok :: b -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058796"><span class="hs-identifier hs-var hs-var">pcok</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058817"><span class="hs-identifier hs-var">cok</span></a></span><span>
</span><span id="line-342"></span><span>                </span><span id="local-6989586621679058795"><span class="annot"><span class="annottext">peok :: b -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058795"><span class="hs-identifier hs-var hs-var">peok</span></a></span></span><span> </span><span id="local-6989586621679058794"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679058794"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679058793"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058793"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679058792"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058792"><span class="hs-identifier hs-var">err'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058815"><span class="hs-identifier hs-var">eok</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679058794"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058793"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ParseError -&gt; ParseError -&gt; ParseError
</span><a href="Text.Parsec.Error.html#mergeError"><span class="hs-identifier hs-var">mergeError</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058797"><span class="hs-identifier hs-var">err</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058792"><span class="hs-identifier hs-var">err'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-343"></span><span>                </span><span id="local-6989586621679058791"><span class="annot"><span class="annottext">pcerr :: ParseError -&gt; m b
</span><a href="#local-6989586621679058791"><span class="hs-identifier hs-var hs-var">pcerr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058816"><span class="hs-identifier hs-var">cerr</span></a></span><span>
</span><span id="line-344"></span><span>                </span><span id="local-6989586621679058790"><span class="annot"><span class="annottext">peerr :: ParseError -&gt; m b
</span><a href="#local-6989586621679058790"><span class="hs-identifier hs-var hs-var">peerr</span></a></span></span><span> </span><span id="local-6989586621679058789"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058789"><span class="hs-identifier hs-var">err'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058814"><span class="hs-identifier hs-var">eerr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ParseError -&gt; ParseError -&gt; ParseError
</span><a href="Text.Parsec.Error.html#mergeError"><span class="hs-identifier hs-var">mergeError</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058797"><span class="hs-identifier hs-var">err</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058789"><span class="hs-identifier hs-var">err'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-345"></span><span>            </span><span class="hs-keyword">in</span><span>  </span><span class="annot"><span class="annottext">ParsecT s u m b
-&gt; forall b.
   State s u
   -&gt; (b -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (b -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
forall s u (m :: * -&gt; *) a.
ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
</span><a href="Text.Parsec.Prim.html#unParser"><span class="hs-identifier hs-var hs-var">unParser</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ParsecT s u m b
</span><a href="#local-6989586621679058819"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058799"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058798"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058796"><span class="hs-identifier hs-var">pcok</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058791"><span class="hs-identifier hs-var">pcerr</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058795"><span class="hs-identifier hs-var">peok</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058790"><span class="hs-identifier hs-var">peerr</span></a></span><span>
</span><span id="line-346"></span><span>        </span><span class="hs-comment">-- consumed-error case for m</span><span>
</span><span id="line-347"></span><span>        </span><span id="local-6989586621679058788"><span class="annot"><span class="annottext">mcerr :: ParseError -&gt; m b
</span><a href="#local-6989586621679058788"><span class="hs-identifier hs-var hs-var">mcerr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058816"><span class="hs-identifier hs-var">cerr</span></a></span><span>
</span><span id="line-348"></span><span>
</span><span id="line-349"></span><span>        </span><span class="hs-comment">-- empty-error case for m</span><span>
</span><span id="line-350"></span><span>        </span><span id="local-6989586621679058787"><span class="annot"><span class="annottext">meerr :: ParseError -&gt; m b
</span><a href="#local-6989586621679058787"><span class="hs-identifier hs-var hs-var">meerr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058814"><span class="hs-identifier hs-var">eerr</span></a></span><span>
</span><span id="line-351"></span><span>
</span><span id="line-352"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
forall s u (m :: * -&gt; *) a.
ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
</span><a href="Text.Parsec.Prim.html#unParser"><span class="hs-identifier hs-var hs-var">unParser</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058820"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058818"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058813"><span class="hs-identifier hs-var">mcok</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058788"><span class="hs-identifier hs-var">mcerr</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058800"><span class="hs-identifier hs-var">meok</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058787"><span class="hs-identifier hs-var">meerr</span></a></span><span>
</span><span id="line-353"></span><span>
</span><span id="line-354"></span><span>
</span><span id="line-355"></span><span id="local-6989586621679059504"><span id="local-6989586621679059505"><span id="local-6989586621679059506"><span class="annot"><a href="Text.Parsec.Prim.html#mergeErrorReply"><span class="hs-identifier hs-type">mergeErrorReply</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.Parsec.Error.html#ParseError"><span class="hs-identifier hs-type">ParseError</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#Reply"><span class="hs-identifier hs-type">Reply</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059506"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059505"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059504"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#Reply"><span class="hs-identifier hs-type">Reply</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059506"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059505"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059504"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-356"></span><span id="mergeErrorReply"><span class="annot"><span class="annottext">mergeErrorReply :: forall s u a. ParseError -&gt; Reply s u a -&gt; Reply s u a
</span><a href="Text.Parsec.Prim.html#mergeErrorReply"><span class="hs-identifier hs-var hs-var">mergeErrorReply</span></a></span></span><span> </span><span id="local-6989586621679058786"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058786"><span class="hs-identifier hs-var">err1</span></a></span></span><span> </span><span id="local-6989586621679058785"><span class="annot"><span class="annottext">Reply s u a
</span><a href="#local-6989586621679058785"><span class="hs-identifier hs-var">reply</span></a></span></span><span> </span><span class="hs-comment">-- XXX where to put it?</span><span>
</span><span id="line-357"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Reply s u a
</span><a href="#local-6989586621679058785"><span class="hs-identifier hs-var">reply</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-358"></span><span>        </span><span class="annot"><a href="Text.Parsec.Prim.html#Ok"><span class="hs-identifier hs-type">Ok</span></a></span><span> </span><span id="local-6989586621679058784"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058784"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679058783"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058783"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span id="local-6989586621679058782"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058782"><span class="hs-identifier hs-var">err2</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; Reply s u a
forall s u a. a -&gt; State s u -&gt; ParseError -&gt; Reply s u a
</span><a href="Text.Parsec.Prim.html#Ok"><span class="hs-identifier hs-var">Ok</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058784"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058783"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ParseError -&gt; ParseError -&gt; ParseError
</span><a href="Text.Parsec.Error.html#mergeError"><span class="hs-identifier hs-var">mergeError</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058786"><span class="hs-identifier hs-var">err1</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058782"><span class="hs-identifier hs-var">err2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-359"></span><span>        </span><span class="annot"><a href="Text.Parsec.Prim.html#Error"><span class="hs-identifier hs-type">Error</span></a></span><span> </span><span id="local-6989586621679058781"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058781"><span class="hs-identifier hs-var">err2</span></a></span></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; Reply s u a
forall s u a. ParseError -&gt; Reply s u a
</span><a href="Text.Parsec.Prim.html#Error"><span class="hs-identifier hs-var">Error</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ParseError -&gt; ParseError -&gt; ParseError
</span><a href="Text.Parsec.Error.html#mergeError"><span class="hs-identifier hs-var">mergeError</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058786"><span class="hs-identifier hs-var">err1</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058781"><span class="hs-identifier hs-var">err2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-360"></span><span>
</span><span id="line-361"></span><span id="local-6989586621679058777"><span id="local-6989586621679058778"><span id="local-6989586621679058779"><span id="local-6989586621679058780"><span class="annot"><a href="Text.Parsec.Prim.html#parserFail"><span class="hs-identifier hs-type">parserFail</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058780"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058779"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058778"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058777"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span><span>
</span><span id="line-362"></span><span id="parserFail"><span class="annot"><span class="annottext">parserFail :: forall s u (m :: * -&gt; *) a. String -&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#parserFail"><span class="hs-identifier hs-var hs-var">parserFail</span></a></span></span><span> </span><span id="local-6989586621679058776"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679058776"><span class="hs-identifier hs-var">msg</span></a></span></span><span>
</span><span id="line-363"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
forall s u (m :: * -&gt; *) a.
(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-var">ParsecT</span></a></span><span> </span><span class="annot"><span class="annottext">((forall b.
  State s u
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; m b)
 -&gt; ParsecT s u m a)
-&gt; (forall b.
    State s u
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; m b)
-&gt; ParsecT s u m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679058775"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058775"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679058774"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058774"><span class="hs-identifier hs-var">eerr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-364"></span><span>      </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058774"><span class="hs-identifier hs-var">eerr</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseError -&gt; m b) -&gt; ParseError -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Message -&gt; SourcePos -&gt; ParseError
</span><a href="Text.Parsec.Error.html#newErrorMessage"><span class="hs-identifier hs-var">newErrorMessage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Message
</span><a href="Text.Parsec.Error.html#Message"><span class="hs-identifier hs-var">Message</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679058776"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">State s u -&gt; SourcePos
forall s u. State s u -&gt; SourcePos
</span><a href="Text.Parsec.Prim.html#statePos"><span class="hs-identifier hs-var hs-var">statePos</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058775"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-365"></span><span>
</span><span id="line-366"></span><span id="local-6989586621679059607"><span id="local-6989586621679059608"><span id="local-6989586621679059609"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#MonadPlus"><span class="hs-identifier hs-type">MonadPlus</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059609"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059608"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059607"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-367"></span><span>    </span><span id="local-6989586621679058765"><span class="annot"><span class="annottext">mzero :: forall a. ParsecT s u m a
</span><a href="#local-6989586621679058765"><span class="hs-identifier hs-var hs-var hs-var hs-var">mzero</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
forall s u (m :: * -&gt; *) a. ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#parserZero"><span class="hs-identifier hs-var">parserZero</span></a></span><span>
</span><span id="line-368"></span><span>    </span><span id="local-6989586621679058764"><span class="annot"><span class="annottext">mplus :: forall a. ParsecT s u m a -&gt; ParsecT s u m a -&gt; ParsecT s u m a
</span><a href="#local-6989586621679058764"><span class="hs-identifier hs-var hs-var hs-var hs-var">mplus</span></a></span></span><span> </span><span id="local-6989586621679058763"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058763"><span class="hs-identifier hs-var">p1</span></a></span></span><span> </span><span id="local-6989586621679058762"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058762"><span class="hs-identifier hs-var">p2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a -&gt; ParsecT s u m a -&gt; ParsecT s u m a
forall s u (m :: * -&gt; *) a.
ParsecT s u m a -&gt; ParsecT s u m a -&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#parserPlus"><span class="hs-identifier hs-var">parserPlus</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058763"><span class="hs-identifier hs-var">p1</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058762"><span class="hs-identifier hs-var">p2</span></a></span></span></span></span><span>
</span><span id="line-369"></span><span>
</span><span id="line-370"></span><span class="hs-comment">-- | @parserZero@ always fails without consuming any input. @parserZero@ is defined</span><span>
</span><span id="line-371"></span><span class="hs-comment">-- equal to the 'mzero' member of the 'MonadPlus' class and to the 'Control.Applicative.empty' member</span><span>
</span><span id="line-372"></span><span class="hs-comment">-- of the 'Control.Applicative.Alternative' class.</span><span>
</span><span id="line-373"></span><span>
</span><span id="line-374"></span><span id="local-6989586621679058758"><span id="local-6989586621679058759"><span id="local-6989586621679058760"><span id="local-6989586621679058761"><span class="annot"><a href="Text.Parsec.Prim.html#parserZero"><span class="hs-identifier hs-type">parserZero</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058761"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058760"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058759"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058758"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span><span>
</span><span id="line-375"></span><span id="parserZero"><span class="annot"><span class="annottext">parserZero :: forall s u (m :: * -&gt; *) a. ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#parserZero"><span class="hs-identifier hs-var hs-var">parserZero</span></a></span></span><span>
</span><span id="line-376"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
forall s u (m :: * -&gt; *) a.
(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-var">ParsecT</span></a></span><span> </span><span class="annot"><span class="annottext">((forall b.
  State s u
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; m b)
 -&gt; ParsecT s u m a)
-&gt; (forall b.
    State s u
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; m b)
-&gt; ParsecT s u m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679058757"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058757"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679058756"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058756"><span class="hs-identifier hs-var">eerr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-377"></span><span>      </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058756"><span class="hs-identifier hs-var">eerr</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseError -&gt; m b) -&gt; ParseError -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">State s u -&gt; ParseError
forall s u. State s u -&gt; ParseError
</span><a href="Text.Parsec.Prim.html#unknownError"><span class="hs-identifier hs-var">unknownError</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058757"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-378"></span><span>
</span><span id="line-379"></span><span id="local-6989586621679058752"><span id="local-6989586621679058753"><span id="local-6989586621679058754"><span id="local-6989586621679058755"><span class="annot"><a href="Text.Parsec.Prim.html#parserPlus"><span class="hs-identifier hs-type">parserPlus</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058755"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058754"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058753"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058752"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058755"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058754"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058753"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058752"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058755"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058754"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058753"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058752"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span><span>
</span><span id="line-380"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#parserPlus"><span class="hs-pragma hs-type">parserPlus</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-381"></span><span id="parserPlus"><span class="annot"><span class="annottext">parserPlus :: forall s u (m :: * -&gt; *) a.
ParsecT s u m a -&gt; ParsecT s u m a -&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#parserPlus"><span class="hs-identifier hs-var hs-var">parserPlus</span></a></span></span><span> </span><span id="local-6989586621679058751"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058751"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679058750"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058750"><span class="hs-identifier hs-var">n</span></a></span></span><span>
</span><span id="line-382"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
forall s u (m :: * -&gt; *) a.
(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-var">ParsecT</span></a></span><span> </span><span class="annot"><span class="annottext">((forall b.
  State s u
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; m b)
 -&gt; ParsecT s u m a)
-&gt; (forall b.
    State s u
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; m b)
-&gt; ParsecT s u m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679058749"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058749"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679058748"><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058748"><span class="hs-identifier hs-var">cok</span></a></span></span><span> </span><span id="local-6989586621679058747"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058747"><span class="hs-identifier hs-var">cerr</span></a></span></span><span> </span><span id="local-6989586621679058746"><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058746"><span class="hs-identifier hs-var">eok</span></a></span></span><span> </span><span id="local-6989586621679058745"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058745"><span class="hs-identifier hs-var">eerr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-383"></span><span>      </span><span class="hs-keyword">let</span><span>
</span><span id="line-384"></span><span>          </span><span id="local-6989586621679058744"><span class="annot"><span class="annottext">meerr :: ParseError -&gt; m b
</span><a href="#local-6989586621679058744"><span class="hs-identifier hs-var hs-var">meerr</span></a></span></span><span> </span><span id="local-6989586621679058743"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058743"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-385"></span><span>              </span><span class="hs-keyword">let</span><span>
</span><span id="line-386"></span><span>                  </span><span id="local-6989586621679058742"><span class="annot"><span class="annottext">neok :: a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058742"><span class="hs-identifier hs-var hs-var">neok</span></a></span></span><span> </span><span id="local-6989586621679058741"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058741"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span id="local-6989586621679058740"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058740"><span class="hs-identifier hs-var">s'</span></a></span></span><span> </span><span id="local-6989586621679058739"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058739"><span class="hs-identifier hs-var">err'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058746"><span class="hs-identifier hs-var">eok</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058741"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058740"><span class="hs-identifier hs-var">s'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ParseError -&gt; ParseError -&gt; ParseError
</span><a href="Text.Parsec.Error.html#mergeError"><span class="hs-identifier hs-var">mergeError</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058743"><span class="hs-identifier hs-var">err</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058739"><span class="hs-identifier hs-var">err'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-387"></span><span>                  </span><span id="local-6989586621679058738"><span class="annot"><span class="annottext">neerr :: ParseError -&gt; m b
</span><a href="#local-6989586621679058738"><span class="hs-identifier hs-var hs-var">neerr</span></a></span></span><span> </span><span id="local-6989586621679058737"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058737"><span class="hs-identifier hs-var">err'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058745"><span class="hs-identifier hs-var">eerr</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseError -&gt; m b) -&gt; ParseError -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; ParseError -&gt; ParseError
</span><a href="Text.Parsec.Error.html#mergeError"><span class="hs-identifier hs-var">mergeError</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058743"><span class="hs-identifier hs-var">err</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058737"><span class="hs-identifier hs-var">err'</span></a></span><span>
</span><span id="line-388"></span><span>              </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
forall s u (m :: * -&gt; *) a.
ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
</span><a href="Text.Parsec.Prim.html#unParser"><span class="hs-identifier hs-var hs-var">unParser</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058750"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058749"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058748"><span class="hs-identifier hs-var">cok</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058747"><span class="hs-identifier hs-var">cerr</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058742"><span class="hs-identifier hs-var">neok</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058738"><span class="hs-identifier hs-var">neerr</span></a></span><span>
</span><span id="line-389"></span><span>      </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
forall s u (m :: * -&gt; *) a.
ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
</span><a href="Text.Parsec.Prim.html#unParser"><span class="hs-identifier hs-var hs-var">unParser</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058751"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058749"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058748"><span class="hs-identifier hs-var">cok</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058747"><span class="hs-identifier hs-var">cerr</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058746"><span class="hs-identifier hs-var">eok</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058744"><span class="hs-identifier hs-var">meerr</span></a></span><span>
</span><span id="line-390"></span><span>
</span><span id="line-391"></span><span id="local-6989586621679059569"><span id="local-6989586621679059570"><span class="hs-keyword">instance</span><span> </span><span class="annot"><span class="hs-identifier hs-type">MonadTrans</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059570"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059569"><span class="hs-identifier hs-type">u</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-392"></span><span>    </span><span id="local-6989586621679058733"><span class="annot"><span class="annottext">lift :: forall (m :: * -&gt; *) a. Monad m =&gt; m a -&gt; ParsecT s u m a
</span><a href="#local-6989586621679058733"><span class="hs-identifier hs-var hs-var hs-var hs-var">lift</span></a></span></span><span> </span><span id="local-6989586621679058732"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679058732"><span class="hs-identifier hs-var">amb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
forall s u (m :: * -&gt; *) a.
(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-var">ParsecT</span></a></span><span> </span><span class="annot"><span class="annottext">((forall b.
  State s u
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; m b)
 -&gt; ParsecT s u m a)
-&gt; (forall b.
    State s u
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; m b)
-&gt; ParsecT s u m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679058730"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058730"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679058729"><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058729"><span class="hs-identifier hs-var">eok</span></a></span></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-393"></span><span>               </span><span id="local-6989586621679058728"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058728"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679058732"><span class="hs-identifier hs-var">amb</span></a></span><span>
</span><span id="line-394"></span><span>               </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058729"><span class="hs-identifier hs-var">eok</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058728"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058730"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseError -&gt; m b) -&gt; ParseError -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">State s u -&gt; ParseError
forall s u. State s u -&gt; ParseError
</span><a href="Text.Parsec.Prim.html#unknownError"><span class="hs-identifier hs-var">unknownError</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058730"><span class="hs-identifier hs-var">s</span></a></span></span></span><span>
</span><span id="line-395"></span><span>
</span><span id="line-396"></span><span class="hs-keyword">infix</span><span>  </span><span class="hs-number">0</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#%3C%3F%3E"><span class="hs-operator hs-type">&lt;?&gt;</span></a></span><span>
</span><span id="line-397"></span><span class="hs-keyword">infixr</span><span> </span><span class="hs-number">1</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#%3C%7C%3E"><span class="hs-operator hs-type">&lt;|&gt;</span></a></span><span>
</span><span id="line-398"></span><span>
</span><span id="line-399"></span><span class="hs-comment">-- | The parser @p \&lt;?&gt; msg@ behaves as parser @p@, but whenever the</span><span>
</span><span id="line-400"></span><span class="hs-comment">-- parser @p@ fails /without consuming any input/, it replaces expect</span><span>
</span><span id="line-401"></span><span class="hs-comment">-- error messages with the expect error message @msg@.</span><span>
</span><span id="line-402"></span><span class="hs-comment">--</span><span>
</span><span id="line-403"></span><span class="hs-comment">-- This is normally used at the end of a set alternatives where we want</span><span>
</span><span id="line-404"></span><span class="hs-comment">-- to return an error message in terms of a higher level construct</span><span>
</span><span id="line-405"></span><span class="hs-comment">-- rather than returning all possible characters. For example, if the</span><span>
</span><span id="line-406"></span><span class="hs-comment">-- @expr@ parser from the 'try' example would fail, the error</span><span>
</span><span id="line-407"></span><span class="hs-comment">-- message is: '...: expecting expression'. Without the @(\&lt;?&gt;)@</span><span>
</span><span id="line-408"></span><span class="hs-comment">-- combinator, the message would be like '...: expecting \&quot;let\&quot; or</span><span>
</span><span id="line-409"></span><span class="hs-comment">-- letter', which is less friendly.</span><span>
</span><span id="line-410"></span><span>
</span><span id="line-411"></span><span id="local-6989586621679059472"><span id="local-6989586621679059473"><span id="local-6989586621679059474"><span id="local-6989586621679059475"><span class="annot"><a href="Text.Parsec.Prim.html#%3C%3F%3E"><span class="hs-operator hs-type">(&lt;?&gt;)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059475"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059474"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059473"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059472"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059475"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059474"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059473"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059472"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span></span></span><span>
</span><span id="line-412"></span><span id="local-6989586621679058727"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058727"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="%3C%3F%3E"><span class="annot"><span class="annottext">&lt;?&gt; :: forall s u (m :: * -&gt; *) a.
ParsecT s u m a -&gt; String -&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#%3C%3F%3E"><span class="hs-operator hs-var hs-var">&lt;?&gt;</span></a></span></span><span> </span><span id="local-6989586621679058726"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679058726"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a -&gt; String -&gt; ParsecT s u m a
forall s u (m :: * -&gt; *) a.
ParsecT s u m a -&gt; String -&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#label"><span class="hs-keyword hs-var">label</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058727"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679058726"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-413"></span><span>
</span><span id="line-414"></span><span class="hs-comment">-- | This combinator implements choice. The parser @p \&lt;|&gt; q@ first</span><span>
</span><span id="line-415"></span><span class="hs-comment">-- applies @p@. If it succeeds, the value of @p@ is returned. If @p@</span><span>
</span><span id="line-416"></span><span class="hs-comment">-- fails /without consuming any input/, parser @q@ is tried. This</span><span>
</span><span id="line-417"></span><span class="hs-comment">-- combinator is defined equal to the 'mplus' member of the 'MonadPlus'</span><span>
</span><span id="line-418"></span><span class="hs-comment">-- class and the ('Control.Applicative.&lt;|&gt;') member of 'Control.Applicative.Alternative'.</span><span>
</span><span id="line-419"></span><span class="hs-comment">--</span><span>
</span><span id="line-420"></span><span class="hs-comment">-- The parser is called /predictive/ since @q@ is only tried when</span><span>
</span><span id="line-421"></span><span class="hs-comment">-- parser @p@ didn't consume any input (i.e.. the look ahead is 1).</span><span>
</span><span id="line-422"></span><span class="hs-comment">-- This non-backtracking behaviour allows for both an efficient</span><span>
</span><span id="line-423"></span><span class="hs-comment">-- implementation of the parser combinators and the generation of good</span><span>
</span><span id="line-424"></span><span class="hs-comment">-- error messages.</span><span>
</span><span id="line-425"></span><span>
</span><span id="line-426"></span><span id="local-6989586621679058722"><span id="local-6989586621679058723"><span id="local-6989586621679058724"><span id="local-6989586621679058725"><span class="annot"><a href="Text.Parsec.Prim.html#%3C%7C%3E"><span class="hs-operator hs-type">(&lt;|&gt;)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058725"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058724"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058723"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058722"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058725"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058724"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058723"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058722"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058725"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058724"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058723"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058722"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span></span></span><span>
</span><span id="line-427"></span><span id="local-6989586621679058720"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058720"><span class="hs-identifier hs-var">p1</span></a></span></span><span> </span><span id="%3C%7C%3E"><span class="annot"><span class="annottext">&lt;|&gt; :: forall s u (m :: * -&gt; *) a.
ParsecT s u m a -&gt; ParsecT s u m a -&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#%3C%7C%3E"><span class="hs-operator hs-var hs-var">&lt;|&gt;</span></a></span></span><span> </span><span id="local-6989586621679058719"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058719"><span class="hs-identifier hs-var">p2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a -&gt; ParsecT s u m a -&gt; ParsecT s u m a
forall (m :: * -&gt; *) a. MonadPlus m =&gt; m a -&gt; m a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#mplus"><span class="hs-identifier hs-var">mplus</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058720"><span class="hs-identifier hs-var">p1</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058719"><span class="hs-identifier hs-var">p2</span></a></span><span>
</span><span id="line-428"></span><span>
</span><span id="line-429"></span><span class="hs-comment">-- | A synonym for @\&lt;?&gt;@, but as a function instead of an operator.</span><span>
</span><span id="line-430"></span><span id="local-6989586621679058715"><span id="local-6989586621679058716"><span id="local-6989586621679058717"><span id="local-6989586621679058718"><span class="annot"><a href="Text.Parsec.Prim.html#label"><span class="hs-keyword hs-type">label</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058718"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058717"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058716"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058715"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058718"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058717"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058716"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058715"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span><span>
</span><span id="line-431"></span><span id="label"><span class="annot"><span class="annottext">label :: forall s u (m :: * -&gt; *) a.
ParsecT s u m a -&gt; String -&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#label"><span class="hs-keyword hs-var hs-var">label</span></a></span></span><span> </span><span id="local-6989586621679058714"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058714"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679058713"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679058713"><span class="hs-identifier hs-var">msg</span></a></span></span><span>
</span><span id="line-432"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a -&gt; [String] -&gt; ParsecT s u m a
forall s u (m :: * -&gt; *) a.
ParsecT s u m a -&gt; [String] -&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#labels"><span class="hs-identifier hs-var">labels</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058714"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679058713"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-433"></span><span>
</span><span id="line-434"></span><span id="local-6989586621679059456"><span id="local-6989586621679059457"><span id="local-6989586621679059458"><span id="local-6989586621679059459"><span class="annot"><a href="Text.Parsec.Prim.html#labels"><span class="hs-identifier hs-type">labels</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059459"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059458"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059457"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059456"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059459"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059458"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059457"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059456"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span><span>
</span><span id="line-435"></span><span id="labels"><span class="annot"><span class="annottext">labels :: forall s u (m :: * -&gt; *) a.
ParsecT s u m a -&gt; [String] -&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#labels"><span class="hs-identifier hs-var hs-var">labels</span></a></span></span><span> </span><span id="local-6989586621679058712"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058712"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679058711"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679058711"><span class="hs-identifier hs-var">msgs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-436"></span><span>    </span><span class="annot"><span class="annottext">(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
forall s u (m :: * -&gt; *) a.
(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-var">ParsecT</span></a></span><span> </span><span class="annot"><span class="annottext">((forall b.
  State s u
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; m b)
 -&gt; ParsecT s u m a)
-&gt; (forall b.
    State s u
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; m b)
-&gt; ParsecT s u m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679058710"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058710"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679058709"><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058709"><span class="hs-identifier hs-var">cok</span></a></span></span><span> </span><span id="local-6989586621679058708"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058708"><span class="hs-identifier hs-var">cerr</span></a></span></span><span> </span><span id="local-6989586621679058707"><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058707"><span class="hs-identifier hs-var">eok</span></a></span></span><span> </span><span id="local-6989586621679058706"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058706"><span class="hs-identifier hs-var">eerr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-437"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679058705"><span class="annot"><span class="annottext">eok' :: a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058705"><span class="hs-identifier hs-var hs-var">eok'</span></a></span></span><span> </span><span id="local-6989586621679058704"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058704"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679058703"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058703"><span class="hs-identifier hs-var">s'</span></a></span></span><span> </span><span id="local-6989586621679058702"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058702"><span class="hs-identifier hs-var">error</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058707"><span class="hs-identifier hs-var">eok</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058704"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058703"><span class="hs-identifier hs-var">s'</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseError -&gt; m b) -&gt; ParseError -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; Bool
</span><a href="Text.Parsec.Error.html#errorIsUnknown"><span class="hs-identifier hs-var">errorIsUnknown</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058702"><span class="hs-identifier hs-var">error</span></a></span><span>
</span><span id="line-438"></span><span>                  </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058702"><span class="hs-identifier hs-var">error</span></a></span><span>
</span><span id="line-439"></span><span>                  </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; [String] -&gt; ParseError
</span><a href="#local-6989586621679058700"><span class="hs-identifier hs-var">setExpectErrors</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058702"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679058711"><span class="hs-identifier hs-var">msgs</span></a></span><span>
</span><span id="line-440"></span><span>        </span><span id="local-6989586621679058699"><span class="annot"><span class="annottext">eerr' :: ParseError -&gt; m b
</span><a href="#local-6989586621679058699"><span class="hs-identifier hs-var hs-var">eerr'</span></a></span></span><span> </span><span id="local-6989586621679058698"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058698"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058706"><span class="hs-identifier hs-var">eerr</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseError -&gt; m b) -&gt; ParseError -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; [String] -&gt; ParseError
</span><a href="#local-6989586621679058700"><span class="hs-identifier hs-var">setExpectErrors</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058698"><span class="hs-identifier hs-var">err</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679058711"><span class="hs-identifier hs-var">msgs</span></a></span><span>
</span><span id="line-441"></span><span>
</span><span id="line-442"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
forall s u (m :: * -&gt; *) a.
ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
</span><a href="Text.Parsec.Prim.html#unParser"><span class="hs-identifier hs-var hs-var">unParser</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058712"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058710"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058709"><span class="hs-identifier hs-var">cok</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058708"><span class="hs-identifier hs-var">cerr</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058705"><span class="hs-identifier hs-var">eok'</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058699"><span class="hs-identifier hs-var">eerr'</span></a></span><span>
</span><span id="line-443"></span><span>
</span><span id="line-444"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-445"></span><span>   </span><span id="local-6989586621679058700"><span class="annot"><span class="annottext">setExpectErrors :: ParseError -&gt; [String] -&gt; ParseError
</span><a href="#local-6989586621679058700"><span class="hs-identifier hs-var hs-var">setExpectErrors</span></a></span></span><span> </span><span id="local-6989586621679058695"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058695"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Message -&gt; ParseError -&gt; ParseError
</span><a href="Text.Parsec.Error.html#setErrorMessage"><span class="hs-identifier hs-var">setErrorMessage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Message
</span><a href="Text.Parsec.Error.html#Expect"><span class="hs-identifier hs-var">Expect</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058695"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-446"></span><span>   </span><span class="annot"><a href="#local-6989586621679058700"><span class="hs-identifier hs-var">setExpectErrors</span></a></span><span> </span><span id="local-6989586621679058692"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058692"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-special">[</span><span id="local-6989586621679058691"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679058691"><span class="hs-identifier hs-var">msg</span></a></span></span><span class="hs-special">]</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Message -&gt; ParseError -&gt; ParseError
</span><a href="Text.Parsec.Error.html#setErrorMessage"><span class="hs-identifier hs-var">setErrorMessage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Message
</span><a href="Text.Parsec.Error.html#Expect"><span class="hs-identifier hs-var">Expect</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679058691"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058692"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-447"></span><span>   </span><span class="annot"><a href="#local-6989586621679058700"><span class="hs-identifier hs-var">setExpectErrors</span></a></span><span> </span><span id="local-6989586621679058690"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058690"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679058689"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679058689"><span class="hs-identifier hs-var">msg</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679058688"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679058688"><span class="hs-identifier hs-var">msgs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-448"></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseError -&gt; ParseError)
-&gt; ParseError -&gt; [String] -&gt; ParseError
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679058686"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679058686"><span class="hs-identifier hs-var">msg'</span></a></span></span><span> </span><span id="local-6989586621679058685"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058685"><span class="hs-identifier hs-var">err'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Message -&gt; ParseError -&gt; ParseError
</span><a href="Text.Parsec.Error.html#addErrorMessage"><span class="hs-identifier hs-var">addErrorMessage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Message
</span><a href="Text.Parsec.Error.html#Expect"><span class="hs-identifier hs-var">Expect</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679058686"><span class="hs-identifier hs-var">msg'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058685"><span class="hs-identifier hs-var">err'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-449"></span><span>         </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Message -&gt; ParseError -&gt; ParseError
</span><a href="Text.Parsec.Error.html#setErrorMessage"><span class="hs-identifier hs-var">setErrorMessage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Message
</span><a href="Text.Parsec.Error.html#Expect"><span class="hs-identifier hs-var">Expect</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679058689"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058690"><span class="hs-identifier hs-var">err</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679058688"><span class="hs-identifier hs-var">msgs</span></a></span><span>
</span><span id="line-450"></span><span>
</span><span id="line-451"></span><span class="hs-comment">-- TODO: There should be a stronger statement that can be made about this</span><span>
</span><span id="line-452"></span><span>
</span><span id="line-453"></span><span class="hs-comment">-- | An instance of @Stream@ has stream type @s@, underlying monad @m@ and token type @t@ determined by the stream</span><span>
</span><span id="line-454"></span><span class="hs-comment">--</span><span>
</span><span id="line-455"></span><span class="hs-comment">-- Some rough guidelines for a \&quot;correct\&quot; instance of Stream:</span><span>
</span><span id="line-456"></span><span class="hs-comment">--</span><span>
</span><span id="line-457"></span><span class="hs-comment">--    * unfoldM uncons gives the [t] corresponding to the stream</span><span>
</span><span id="line-458"></span><span class="hs-comment">--</span><span>
</span><span id="line-459"></span><span class="hs-comment">--    * A @Stream@ instance is responsible for maintaining the \&quot;position within the stream\&quot; in the stream state @s@.  This is trivial unless you are using the monad in a non-trivial way.</span><span>
</span><span id="line-460"></span><span>
</span><span id="line-461"></span><span class="hs-keyword">class</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059446"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="Stream"><span class="annot"><a href="Text.Parsec.Prim.html#Stream"><span class="hs-identifier hs-var">Stream</span></a></span></span><span> </span><span id="local-6989586621679059447"><span class="annot"><a href="#local-6989586621679059447"><span class="hs-identifier hs-type">s</span></a></span></span><span> </span><span id="local-6989586621679059446"><span class="annot"><a href="#local-6989586621679059446"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span id="local-6989586621679059445"><span class="annot"><a href="#local-6989586621679059445"><span class="hs-identifier hs-type">t</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="#local-6989586621679059447"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059445"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-462"></span><span>    </span><span id="uncons"><span class="annot"><a href="Text.Parsec.Prim.html#uncons"><span class="hs-identifier hs-type">uncons</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679059447"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059446"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059445"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679059447"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-463"></span><span>
</span><span id="line-464"></span><span id="local-6989586621679059441"><span id="local-6989586621679059442"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059442"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#Stream"><span class="hs-identifier hs-type">Stream</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679059441"><span class="hs-identifier hs-type">tok</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><a href="#local-6989586621679059442"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059441"><span class="hs-identifier hs-type">tok</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-465"></span><span>    </span><span id="local-6989586621679058673"><span class="annot"><span class="annottext">uncons :: [tok] -&gt; m (Maybe (tok, [tok]))
</span><a href="#local-6989586621679058673"><span class="hs-identifier hs-var hs-var hs-var hs-var">uncons</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (tok, [tok]) -&gt; m (Maybe (tok, [tok]))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe (tok, [tok]) -&gt; m (Maybe (tok, [tok])))
-&gt; Maybe (tok, [tok]) -&gt; m (Maybe (tok, [tok]))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (tok, [tok])
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-466"></span><span>    </span><span class="annot"><a href="Text.Parsec.Prim.html#uncons"><span class="hs-identifier hs-var">uncons</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679058672"><span class="annot"><span class="annottext">tok
</span><a href="#local-6989586621679058672"><span class="hs-identifier hs-var">t</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679058671"><span class="annot"><span class="annottext">[tok]
</span><a href="#local-6989586621679058671"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (tok, [tok]) -&gt; m (Maybe (tok, [tok]))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe (tok, [tok]) -&gt; m (Maybe (tok, [tok])))
-&gt; Maybe (tok, [tok]) -&gt; m (Maybe (tok, [tok]))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(tok, [tok]) -&gt; Maybe (tok, [tok])
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">tok
</span><a href="#local-6989586621679058672"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">[tok]
</span><a href="#local-6989586621679058671"><span class="hs-identifier hs-var">ts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-467"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#uncons"><span class="hs-pragma hs-type">uncons</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span><span>
</span><span id="line-468"></span><span>
</span><span id="line-469"></span><span>
</span><span id="line-470"></span><span id="local-6989586621679059437"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059437"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#Stream"><span class="hs-identifier hs-type">Stream</span></a></span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">CL.ByteString</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059437"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-471"></span><span>    </span><span id="local-6989586621679058664"><span class="annot"><span class="annottext">uncons :: ByteString -&gt; m (Maybe (Char, ByteString))
</span><a href="#local-6989586621679058664"><span class="hs-identifier hs-var hs-var hs-var hs-var">uncons</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Char, ByteString) -&gt; m (Maybe (Char, ByteString))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe (Char, ByteString) -&gt; m (Maybe (Char, ByteString)))
-&gt; (ByteString -&gt; Maybe (Char, ByteString))
-&gt; ByteString
-&gt; m (Maybe (Char, ByteString))
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Maybe (Char, ByteString)
</span><a href="../../bytestring/src/Data.ByteString.Lazy.Char8.html#uncons"><span class="hs-identifier hs-var">CL.uncons</span></a></span></span><span>
</span><span id="line-472"></span><span>
</span><span id="line-473"></span><span id="local-6989586621679059434"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059434"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#Stream"><span class="hs-identifier hs-type">Stream</span></a></span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">C.ByteString</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059434"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-474"></span><span>    </span><span id="local-6989586621679058656"><span class="annot"><span class="annottext">uncons :: ByteString -&gt; m (Maybe (Char, ByteString))
</span><a href="#local-6989586621679058656"><span class="hs-identifier hs-var hs-var hs-var hs-var">uncons</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Char, ByteString) -&gt; m (Maybe (Char, ByteString))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe (Char, ByteString) -&gt; m (Maybe (Char, ByteString)))
-&gt; (ByteString -&gt; Maybe (Char, ByteString))
-&gt; ByteString
-&gt; m (Maybe (Char, ByteString))
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Maybe (Char, ByteString)
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#uncons"><span class="hs-identifier hs-var">C.uncons</span></a></span></span><span>
</span><span id="line-475"></span><span>
</span><span id="line-476"></span><span id="local-6989586621679059431"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059431"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#Stream"><span class="hs-identifier hs-type">Stream</span></a></span><span> </span><span class="annot"><a href="../../text/src/Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">Text.Text</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059431"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-477"></span><span>    </span><span id="local-6989586621679058648"><span class="annot"><span class="annottext">uncons :: Text -&gt; m (Maybe (Char, Text))
</span><a href="#local-6989586621679058648"><span class="hs-identifier hs-var hs-var hs-var hs-var">uncons</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Char, Text) -&gt; m (Maybe (Char, Text))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe (Char, Text) -&gt; m (Maybe (Char, Text)))
-&gt; (Text -&gt; Maybe (Char, Text)) -&gt; Text -&gt; m (Maybe (Char, Text))
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Maybe (Char, Text)
</span><a href="../../text/src/Data.Text.html#uncons"><span class="hs-identifier hs-var">Text.uncons</span></a></span><span>
</span><span id="line-478"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#uncons"><span class="hs-pragma hs-type">uncons</span></a></span><span> </span><span class="hs-pragma">#-}</span></span><span>
</span><span id="line-479"></span><span>
</span><span id="line-480"></span><span id="local-6989586621679059428"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059428"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#Stream"><span class="hs-identifier hs-type">Stream</span></a></span><span> </span><span class="annot"><a href="../../text/src/Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">TextL.Text</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059428"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-481"></span><span>    </span><span id="local-6989586621679058640"><span class="annot"><span class="annottext">uncons :: Text -&gt; m (Maybe (Char, Text))
</span><a href="#local-6989586621679058640"><span class="hs-identifier hs-var hs-var hs-var hs-var">uncons</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Char, Text) -&gt; m (Maybe (Char, Text))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe (Char, Text) -&gt; m (Maybe (Char, Text)))
-&gt; (Text -&gt; Maybe (Char, Text)) -&gt; Text -&gt; m (Maybe (Char, Text))
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Maybe (Char, Text)
</span><a href="../../text/src/Data.Text.Lazy.html#uncons"><span class="hs-identifier hs-var">TextL.uncons</span></a></span><span>
</span><span id="line-482"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#uncons"><span class="hs-pragma hs-type">uncons</span></a></span><span> </span><span class="hs-pragma">#-}</span></span><span>
</span><span id="line-483"></span><span>
</span><span id="line-484"></span><span>
</span><span id="line-485"></span><span id="local-6989586621679059424"><span id="local-6989586621679059425"><span id="local-6989586621679059426"><span id="local-6989586621679059427"><span class="annot"><a href="Text.Parsec.Prim.html#tokens"><span class="hs-identifier hs-type">tokens</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#Stream"><span class="hs-identifier hs-type">Stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059427"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059426"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059425"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Eq</span></span><span> </span><span class="annot"><a href="#local-6989586621679059425"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-486"></span><span>       </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679059425"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span>      </span><span class="hs-comment">-- Pretty print a list of tokens</span><span>
</span><span id="line-487"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679059425"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-488"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679059425"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">]</span><span>                  </span><span class="hs-comment">-- List of tokens to parse</span><span>
</span><span id="line-489"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059427"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059424"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059426"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679059425"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">]</span></span></span></span></span><span>
</span><span id="line-490"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#tokens"><span class="hs-pragma hs-type">tokens</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-491"></span><span id="tokens"><span class="annot"><span class="annottext">tokens :: forall s (m :: * -&gt; *) t u.
(Stream s m t, Eq t) =&gt;
([t] -&gt; String)
-&gt; (SourcePos -&gt; [t] -&gt; SourcePos) -&gt; [t] -&gt; ParsecT s u m [t]
</span><a href="Text.Parsec.Prim.html#tokens"><span class="hs-identifier hs-var hs-var">tokens</span></a></span></span><span> </span><span class="annot"><span class="annottext">[t] -&gt; String
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SourcePos -&gt; [t] -&gt; SourcePos
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-492"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall b.
 State s u
 -&gt; ([t] -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; ([t] -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m [t]
forall s u (m :: * -&gt; *) a.
(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-var">ParsecT</span></a></span><span> </span><span class="annot"><span class="annottext">((forall b.
  State s u
  -&gt; ([t] -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; ([t] -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; m b)
 -&gt; ParsecT s u m [t])
-&gt; (forall b.
    State s u
    -&gt; ([t] -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; ([t] -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; m b)
-&gt; ParsecT s u m [t]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679058635"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058635"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="annot"><span class="annottext">[t] -&gt; State s u -&gt; ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679058634"><span class="annot"><span class="annottext">[t] -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058634"><span class="hs-identifier hs-var">eok</span></a></span></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-493"></span><span>      </span><span class="annot"><span class="annottext">[t] -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058634"><span class="hs-identifier hs-var">eok</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058635"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseError -&gt; m b) -&gt; ParseError -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">State s u -&gt; ParseError
forall s u. State s u -&gt; ParseError
</span><a href="Text.Parsec.Prim.html#unknownError"><span class="hs-identifier hs-var">unknownError</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058635"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-494"></span><span class="annot"><a href="Text.Parsec.Prim.html#tokens"><span class="hs-identifier hs-var">tokens</span></a></span><span> </span><span id="local-6989586621679058633"><span class="annot"><span class="annottext">[t] -&gt; String
</span><a href="#local-6989586621679058633"><span class="hs-identifier hs-var">showTokens</span></a></span></span><span> </span><span id="local-6989586621679058632"><span class="annot"><span class="annottext">SourcePos -&gt; [t] -&gt; SourcePos
</span><a href="#local-6989586621679058632"><span class="hs-identifier hs-var">nextposs</span></a></span></span><span> </span><span id="local-6989586621679058631"><span class="annot"><span class="annottext">tts :: [t]
</span><a href="#local-6989586621679058631"><span class="hs-identifier hs-var">tts</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621679058630"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058630"><span class="hs-identifier hs-var">tok</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679058629"><span class="annot"><span class="annottext">[t]
</span><a href="#local-6989586621679058629"><span class="hs-identifier hs-var">toks</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-495"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall b.
 State s u
 -&gt; ([t] -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; ([t] -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m [t]
forall s u (m :: * -&gt; *) a.
(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-var">ParsecT</span></a></span><span> </span><span class="annot"><span class="annottext">((forall b.
  State s u
  -&gt; ([t] -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; ([t] -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; m b)
 -&gt; ParsecT s u m [t])
-&gt; (forall b.
    State s u
    -&gt; ([t] -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; ([t] -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; m b)
-&gt; ParsecT s u m [t]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span id="local-6989586621679058625"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058625"><span class="hs-identifier hs-var">input</span></a></span></span><span> </span><span id="local-6989586621679058624"><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058624"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span id="local-6989586621679058623"><span class="annot"><span class="annottext">u
</span><a href="#local-6989586621679058623"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679058622"><span class="annot"><span class="annottext">[t] -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058622"><span class="hs-identifier hs-var">cok</span></a></span></span><span> </span><span id="local-6989586621679058621"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058621"><span class="hs-identifier hs-var">cerr</span></a></span></span><span> </span><span id="local-6989586621679058620"><span class="annot"><span class="annottext">[t] -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058620"><span class="hs-identifier hs-var">_eok</span></a></span></span><span> </span><span id="local-6989586621679058619"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058619"><span class="hs-identifier hs-var">eerr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-496"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-497"></span><span>        </span><span id="local-6989586621679058618"><span class="annot"><span class="annottext">errEof :: ParseError
</span><a href="#local-6989586621679058618"><span class="hs-identifier hs-var hs-var">errEof</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Message -&gt; ParseError -&gt; ParseError
</span><a href="Text.Parsec.Error.html#setErrorMessage"><span class="hs-identifier hs-var">setErrorMessage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Message
</span><a href="Text.Parsec.Error.html#Expect"><span class="hs-identifier hs-var">Expect</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[t] -&gt; String
</span><a href="#local-6989586621679058633"><span class="hs-identifier hs-var">showTokens</span></a></span><span> </span><span class="annot"><span class="annottext">[t]
</span><a href="#local-6989586621679058631"><span class="hs-identifier hs-var">tts</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-498"></span><span>                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Message -&gt; SourcePos -&gt; ParseError
</span><a href="Text.Parsec.Error.html#newErrorMessage"><span class="hs-identifier hs-var">newErrorMessage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Message
</span><a href="Text.Parsec.Error.html#SysUnExpect"><span class="hs-identifier hs-var">SysUnExpect</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058624"><span class="hs-identifier hs-var">pos</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-499"></span><span>
</span><span id="line-500"></span><span>        </span><span id="local-6989586621679058617"><span class="annot"><span class="annottext">errExpect :: t -&gt; ParseError
</span><a href="#local-6989586621679058617"><span class="hs-identifier hs-var hs-var">errExpect</span></a></span></span><span> </span><span id="local-6989586621679058616"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058616"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Message -&gt; ParseError -&gt; ParseError
</span><a href="Text.Parsec.Error.html#setErrorMessage"><span class="hs-identifier hs-var">setErrorMessage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Message
</span><a href="Text.Parsec.Error.html#Expect"><span class="hs-identifier hs-var">Expect</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[t] -&gt; String
</span><a href="#local-6989586621679058633"><span class="hs-identifier hs-var">showTokens</span></a></span><span> </span><span class="annot"><span class="annottext">[t]
</span><a href="#local-6989586621679058631"><span class="hs-identifier hs-var">tts</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-501"></span><span>                       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Message -&gt; SourcePos -&gt; ParseError
</span><a href="Text.Parsec.Error.html#newErrorMessage"><span class="hs-identifier hs-var">newErrorMessage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Message
</span><a href="Text.Parsec.Error.html#SysUnExpect"><span class="hs-identifier hs-var">SysUnExpect</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[t] -&gt; String
</span><a href="#local-6989586621679058633"><span class="hs-identifier hs-var">showTokens</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058616"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058624"><span class="hs-identifier hs-var">pos</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-502"></span><span>
</span><span id="line-503"></span><span>        </span><span id="local-6989586621679058612"><span class="annot"><span class="annottext">walk :: [t] -&gt; s -&gt; m b
</span><a href="#local-6989586621679058612"><span class="hs-identifier hs-var hs-var">walk</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span id="local-6989586621679058611"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058611"><span class="hs-identifier hs-var">rs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">s -&gt; m b
</span><a href="#local-6989586621679058610"><span class="hs-identifier hs-var">ok</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058611"><span class="hs-identifier hs-var">rs</span></a></span><span>
</span><span id="line-504"></span><span>        </span><span class="annot"><a href="#local-6989586621679058612"><span class="hs-identifier hs-var">walk</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679058609"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058609"><span class="hs-identifier hs-var">t</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679058608"><span class="annot"><span class="annottext">[t]
</span><a href="#local-6989586621679058608"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679058607"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058607"><span class="hs-identifier hs-var">rs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-505"></span><span>          </span><span id="local-6989586621679058606"><span class="annot"><span class="annottext">Maybe (t, s)
</span><a href="#local-6989586621679058606"><span class="hs-identifier hs-var">sr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">s -&gt; m (Maybe (t, s))
forall s (m :: * -&gt; *) t. Stream s m t =&gt; s -&gt; m (Maybe (t, s))
</span><a href="Text.Parsec.Prim.html#uncons"><span class="hs-identifier hs-var">uncons</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058607"><span class="hs-identifier hs-var">rs</span></a></span><span>
</span><span id="line-506"></span><span>          </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (t, s)
</span><a href="#local-6989586621679058606"><span class="hs-identifier hs-var">sr</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-507"></span><span>            </span><span class="annot"><span class="annottext">Maybe (t, s)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058621"><span class="hs-identifier hs-var">cerr</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseError -&gt; m b) -&gt; ParseError -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058618"><span class="hs-identifier hs-var">errEof</span></a></span><span>
</span><span id="line-508"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679058605"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058605"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679058604"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058604"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058609"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">t -&gt; t -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058605"><span class="hs-identifier hs-var">x</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[t] -&gt; s -&gt; m b
</span><a href="#local-6989586621679058612"><span class="hs-identifier hs-var">walk</span></a></span><span> </span><span class="annot"><span class="annottext">[t]
</span><a href="#local-6989586621679058608"><span class="hs-identifier hs-var">ts</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058604"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-509"></span><span>                        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058621"><span class="hs-identifier hs-var">cerr</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseError -&gt; m b) -&gt; ParseError -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">t -&gt; ParseError
</span><a href="#local-6989586621679058617"><span class="hs-identifier hs-var">errExpect</span></a></span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058605"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-510"></span><span>
</span><span id="line-511"></span><span>        </span><span id="local-6989586621679058610"><span class="annot"><span class="annottext">ok :: s -&gt; m b
</span><a href="#local-6989586621679058610"><span class="hs-identifier hs-var hs-var">ok</span></a></span></span><span> </span><span id="local-6989586621679058603"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058603"><span class="hs-identifier hs-var">rs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679058602"><span class="annot"><span class="annottext">pos' :: SourcePos
</span><a href="#local-6989586621679058602"><span class="hs-identifier hs-var hs-var">pos'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SourcePos -&gt; [t] -&gt; SourcePos
</span><a href="#local-6989586621679058632"><span class="hs-identifier hs-var">nextposs</span></a></span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058624"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">[t]
</span><a href="#local-6989586621679058631"><span class="hs-identifier hs-var">tts</span></a></span><span>
</span><span id="line-512"></span><span>                    </span><span id="local-6989586621679058601"><span class="annot"><span class="annottext">s' :: State s u
</span><a href="#local-6989586621679058601"><span class="hs-identifier hs-var hs-var">s'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">s -&gt; SourcePos -&gt; u -&gt; State s u
forall s u. s -&gt; SourcePos -&gt; u -&gt; State s u
</span><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-var">State</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058603"><span class="hs-identifier hs-var">rs</span></a></span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058602"><span class="hs-identifier hs-var">pos'</span></a></span><span> </span><span class="annot"><span class="annottext">u
</span><a href="#local-6989586621679058623"><span class="hs-identifier hs-var">u</span></a></span><span>
</span><span id="line-513"></span><span>                </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">[t] -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058622"><span class="hs-identifier hs-var">cok</span></a></span><span> </span><span class="annot"><span class="annottext">[t]
</span><a href="#local-6989586621679058631"><span class="hs-identifier hs-var">tts</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058601"><span class="hs-identifier hs-var">s'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SourcePos -&gt; ParseError
</span><a href="Text.Parsec.Error.html#newErrorUnknown"><span class="hs-identifier hs-var">newErrorUnknown</span></a></span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058602"><span class="hs-identifier hs-var">pos'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-514"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-515"></span><span>        </span><span id="local-6989586621679058600"><span class="annot"><span class="annottext">Maybe (t, s)
</span><a href="#local-6989586621679058600"><span class="hs-identifier hs-var">sr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">s -&gt; m (Maybe (t, s))
forall s (m :: * -&gt; *) t. Stream s m t =&gt; s -&gt; m (Maybe (t, s))
</span><a href="Text.Parsec.Prim.html#uncons"><span class="hs-identifier hs-var">uncons</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058625"><span class="hs-identifier hs-var">input</span></a></span><span>
</span><span id="line-516"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (t, s)
</span><a href="#local-6989586621679058600"><span class="hs-identifier hs-var">sr</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-517"></span><span>            </span><span class="annot"><span class="annottext">Maybe (t, s)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058619"><span class="hs-identifier hs-var">eerr</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseError -&gt; m b) -&gt; ParseError -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058618"><span class="hs-identifier hs-var">errEof</span></a></span><span>
</span><span id="line-518"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679058599"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058599"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679058598"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058598"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-519"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058630"><span class="hs-identifier hs-var">tok</span></a></span><span> </span><span class="annot"><span class="annottext">t -&gt; t -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058599"><span class="hs-identifier hs-var">x</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[t] -&gt; s -&gt; m b
</span><a href="#local-6989586621679058612"><span class="hs-identifier hs-var">walk</span></a></span><span> </span><span class="annot"><span class="annottext">[t]
</span><a href="#local-6989586621679058629"><span class="hs-identifier hs-var">toks</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058598"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-520"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058619"><span class="hs-identifier hs-var">eerr</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseError -&gt; m b) -&gt; ParseError -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">t -&gt; ParseError
</span><a href="#local-6989586621679058617"><span class="hs-identifier hs-var">errExpect</span></a></span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058599"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-521"></span><span>
</span><span id="line-522"></span><span class="hs-comment">-- | The parser @try p@ behaves like parser @p@, except that it</span><span>
</span><span id="line-523"></span><span class="hs-comment">-- pretends that it hasn't consumed any input when an error occurs.</span><span>
</span><span id="line-524"></span><span class="hs-comment">--</span><span>
</span><span id="line-525"></span><span class="hs-comment">-- This combinator is used whenever arbitrary look ahead is needed.</span><span>
</span><span id="line-526"></span><span class="hs-comment">-- Since it pretends that it hasn't consumed any input when @p@ fails,</span><span>
</span><span id="line-527"></span><span class="hs-comment">-- the ('&lt;|&gt;') combinator will try its second alternative even when the</span><span>
</span><span id="line-528"></span><span class="hs-comment">-- first parser failed while consuming input.</span><span>
</span><span id="line-529"></span><span class="hs-comment">--</span><span>
</span><span id="line-530"></span><span class="hs-comment">-- The @try@ combinator can for example be used to distinguish</span><span>
</span><span id="line-531"></span><span class="hs-comment">-- identifiers and reserved words. Both reserved words and identifiers</span><span>
</span><span id="line-532"></span><span class="hs-comment">-- are a sequence of letters. Whenever we expect a certain reserved</span><span>
</span><span id="line-533"></span><span class="hs-comment">-- word where we can also expect an identifier we have to use the @try@</span><span>
</span><span id="line-534"></span><span class="hs-comment">-- combinator. Suppose we write:</span><span>
</span><span id="line-535"></span><span class="hs-comment">--</span><span>
</span><span id="line-536"></span><span class="hs-comment">-- &gt;  expr        = letExpr &lt;|&gt; identifier &lt;?&gt; &quot;expression&quot;</span><span>
</span><span id="line-537"></span><span class="hs-comment">-- &gt;</span><span>
</span><span id="line-538"></span><span class="hs-comment">-- &gt;  letExpr     = do{ string &quot;let&quot;; ... }</span><span>
</span><span id="line-539"></span><span class="hs-comment">-- &gt;  identifier  = many1 letter</span><span>
</span><span id="line-540"></span><span class="hs-comment">--</span><span>
</span><span id="line-541"></span><span class="hs-comment">-- If the user writes \&quot;lexical\&quot;, the parser fails with: @unexpected</span><span>
</span><span id="line-542"></span><span class="hs-comment">-- \'x\', expecting \'t\' in \&quot;let\&quot;@. Indeed, since the ('&lt;|&gt;') combinator</span><span>
</span><span id="line-543"></span><span class="hs-comment">-- only tries alternatives when the first alternative hasn't consumed</span><span>
</span><span id="line-544"></span><span class="hs-comment">-- input, the @identifier@ parser is never tried (because the prefix</span><span>
</span><span id="line-545"></span><span class="hs-comment">-- \&quot;le\&quot; of the @string \&quot;let\&quot;@ parser is already consumed). The</span><span>
</span><span id="line-546"></span><span class="hs-comment">-- right behaviour can be obtained by adding the @try@ combinator:</span><span>
</span><span id="line-547"></span><span class="hs-comment">--</span><span>
</span><span id="line-548"></span><span class="hs-comment">-- &gt;  expr        = letExpr &lt;|&gt; identifier &lt;?&gt; &quot;expression&quot;</span><span>
</span><span id="line-549"></span><span class="hs-comment">-- &gt;</span><span>
</span><span id="line-550"></span><span class="hs-comment">-- &gt;  letExpr     = do{ try (string &quot;let&quot;); ... }</span><span>
</span><span id="line-551"></span><span class="hs-comment">-- &gt;  identifier  = many1 letter</span><span>
</span><span id="line-552"></span><span>
</span><span id="line-553"></span><span id="local-6989586621679059413"><span id="local-6989586621679059414"><span id="local-6989586621679059415"><span id="local-6989586621679059416"><span class="annot"><a href="Text.Parsec.Prim.html#try"><span class="hs-identifier hs-type">try</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059416"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059415"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059414"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059413"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059416"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059415"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059414"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059413"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span><span>
</span><span id="line-554"></span><span id="try"><span class="annot"><span class="annottext">try :: forall s u (m :: * -&gt; *) a. ParsecT s u m a -&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#try"><span class="hs-identifier hs-var hs-var">try</span></a></span></span><span> </span><span id="local-6989586621679058597"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058597"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-555"></span><span>    </span><span class="annot"><span class="annottext">(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
forall s u (m :: * -&gt; *) a.
(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-var">ParsecT</span></a></span><span> </span><span class="annot"><span class="annottext">((forall b.
  State s u
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; m b)
 -&gt; ParsecT s u m a)
-&gt; (forall b.
    State s u
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; m b)
-&gt; ParsecT s u m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679058596"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058596"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679058595"><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058595"><span class="hs-identifier hs-var">cok</span></a></span></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679058594"><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058594"><span class="hs-identifier hs-var">eok</span></a></span></span><span> </span><span id="local-6989586621679058593"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058593"><span class="hs-identifier hs-var">eerr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-556"></span><span>    </span><span class="annot"><span class="annottext">ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
forall s u (m :: * -&gt; *) a.
ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
</span><a href="Text.Parsec.Prim.html#unParser"><span class="hs-identifier hs-var hs-var">unParser</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058597"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058596"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058595"><span class="hs-identifier hs-var">cok</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058593"><span class="hs-identifier hs-var">eerr</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058594"><span class="hs-identifier hs-var">eok</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058593"><span class="hs-identifier hs-var">eerr</span></a></span><span>
</span><span id="line-557"></span><span>
</span><span id="line-558"></span><span class="hs-comment">-- | @lookAhead p@ parses @p@ without consuming any input.</span><span>
</span><span id="line-559"></span><span class="hs-comment">--</span><span>
</span><span id="line-560"></span><span class="hs-comment">-- If @p@ fails and consumes some input, so does @lookAhead@. Combine with 'try'</span><span>
</span><span id="line-561"></span><span class="hs-comment">-- if this is undesirable.</span><span>
</span><span id="line-562"></span><span>
</span><span id="line-563"></span><span id="local-6989586621679059403"><span id="local-6989586621679059404"><span id="local-6989586621679059405"><span id="local-6989586621679059406"><span id="local-6989586621679059407"><span class="annot"><a href="Text.Parsec.Prim.html#lookAhead"><span class="hs-identifier hs-type">lookAhead</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#Stream"><span class="hs-identifier hs-type">Stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059407"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059406"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059405"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059407"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059404"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059406"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059403"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059407"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059404"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059406"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059403"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span></span><span>
</span><span id="line-564"></span><span id="lookAhead"><span class="annot"><span class="annottext">lookAhead :: forall s (m :: * -&gt; *) t u a.
Stream s m t =&gt;
ParsecT s u m a -&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#lookAhead"><span class="hs-identifier hs-var hs-var">lookAhead</span></a></span></span><span> </span><span id="local-6989586621679058591"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058591"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-565"></span><span>    </span><span class="annot"><span class="annottext">(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
forall s u (m :: * -&gt; *) a.
(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-var">ParsecT</span></a></span><span> </span><span class="annot"><span class="annottext">((forall b.
  State s u
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; m b)
 -&gt; ParsecT s u m a)
-&gt; (forall b.
    State s u
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; m b)
-&gt; ParsecT s u m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679058590"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058590"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679058589"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058589"><span class="hs-identifier hs-var">cerr</span></a></span></span><span> </span><span id="local-6989586621679058588"><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058588"><span class="hs-identifier hs-var">eok</span></a></span></span><span> </span><span id="local-6989586621679058587"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058587"><span class="hs-identifier hs-var">eerr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-566"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679058586"><span class="annot"><span class="annottext">eok' :: a -&gt; p -&gt; p -&gt; m b
</span><a href="#local-6989586621679058586"><span class="hs-identifier hs-var hs-var">eok'</span></a></span></span><span> </span><span id="local-6989586621679058585"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058585"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="annot"><span class="annottext">p
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">p
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058588"><span class="hs-identifier hs-var">eok</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058585"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058590"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SourcePos -&gt; ParseError
</span><a href="Text.Parsec.Error.html#newErrorUnknown"><span class="hs-identifier hs-var">newErrorUnknown</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">State s u -&gt; SourcePos
forall s u. State s u -&gt; SourcePos
</span><a href="Text.Parsec.Prim.html#statePos"><span class="hs-identifier hs-var hs-var">statePos</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058590"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-567"></span><span>        </span><span class="annot"><span class="annottext">ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
forall s u (m :: * -&gt; *) a.
ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
</span><a href="Text.Parsec.Prim.html#unParser"><span class="hs-identifier hs-var hs-var">unParser</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058591"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058590"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
forall {p} {p}. a -&gt; p -&gt; p -&gt; m b
</span><a href="#local-6989586621679058586"><span class="hs-identifier hs-var">eok'</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058589"><span class="hs-identifier hs-var">cerr</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
forall {p} {p}. a -&gt; p -&gt; p -&gt; m b
</span><a href="#local-6989586621679058586"><span class="hs-identifier hs-var">eok'</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058587"><span class="hs-identifier hs-var">eerr</span></a></span><span>
</span><span id="line-568"></span><span>
</span><span id="line-569"></span><span class="hs-comment">-- | The parser @token showTok posFromTok testTok@ accepts a token @t@</span><span>
</span><span id="line-570"></span><span class="hs-comment">-- with result @x@ when the function @testTok t@ returns @'Just' x@. The</span><span>
</span><span id="line-571"></span><span class="hs-comment">-- source position of the @t@ should be returned by @posFromTok t@ and</span><span>
</span><span id="line-572"></span><span class="hs-comment">-- the token can be shown using @showTok t@.</span><span>
</span><span id="line-573"></span><span class="hs-comment">--</span><span>
</span><span id="line-574"></span><span class="hs-comment">-- This combinator is expressed in terms of 'tokenPrim'.</span><span>
</span><span id="line-575"></span><span class="hs-comment">-- It is used to accept user defined token streams. For example,</span><span>
</span><span id="line-576"></span><span class="hs-comment">-- suppose that we have a stream of basic tokens tupled with source</span><span>
</span><span id="line-577"></span><span class="hs-comment">-- positions. We can then define a parser that accepts single tokens as:</span><span>
</span><span id="line-578"></span><span class="hs-comment">--</span><span>
</span><span id="line-579"></span><span class="hs-comment">-- &gt;  mytoken x</span><span>
</span><span id="line-580"></span><span class="hs-comment">-- &gt;    = token showTok posFromTok testTok</span><span>
</span><span id="line-581"></span><span class="hs-comment">-- &gt;    where</span><span>
</span><span id="line-582"></span><span class="hs-comment">-- &gt;      showTok (pos,t)     = show t</span><span>
</span><span id="line-583"></span><span class="hs-comment">-- &gt;      posFromTok (pos,t)  = pos</span><span>
</span><span id="line-584"></span><span class="hs-comment">-- &gt;      testTok (pos,t)     = if x == t then Just t else Nothing</span><span>
</span><span id="line-585"></span><span>
</span><span id="line-586"></span><span id="local-6989586621679059390"><span id="local-6989586621679059391"><span id="local-6989586621679059392"><span id="local-6989586621679059394"><span class="annot"><a href="Text.Parsec.Prim.html#token"><span class="hs-identifier hs-type">token</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#Stream"><span class="hs-identifier hs-type">Stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059394"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Identity.html#Identity"><span class="hs-identifier hs-type">Identity</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059392"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-587"></span><span>      </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059392"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span>            </span><span class="hs-comment">-- ^ Token pretty-printing function.</span><span>
</span><span id="line-588"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059392"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span class="hs-special">)</span><span>         </span><span class="hs-comment">-- ^ Computes the position of a token.</span><span>
</span><span id="line-589"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059392"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059391"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>           </span><span class="hs-comment">-- ^ Matching function for the token to parse.</span><span>
</span><span id="line-590"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#Parsec"><span class="hs-identifier hs-type">Parsec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059394"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059390"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059391"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span><span>
</span><span id="line-591"></span><span class="hs-pragma">{-# INLINABLE</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#token"><span class="hs-pragma hs-type">token</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-592"></span><span id="token"><span class="annot"><span class="annottext">token :: forall s t a u.
Stream s Identity t =&gt;
(t -&gt; String) -&gt; (t -&gt; SourcePos) -&gt; (t -&gt; Maybe a) -&gt; Parsec s u a
</span><a href="Text.Parsec.Prim.html#token"><span class="hs-identifier hs-var hs-var">token</span></a></span></span><span> </span><span id="local-6989586621679058581"><span class="annot"><span class="annottext">t -&gt; String
</span><a href="#local-6989586621679058581"><span class="hs-identifier hs-var">showToken</span></a></span></span><span> </span><span id="local-6989586621679058580"><span class="annot"><span class="annottext">t -&gt; SourcePos
</span><a href="#local-6989586621679058580"><span class="hs-identifier hs-var">tokpos</span></a></span></span><span> </span><span id="local-6989586621679058579"><span class="annot"><span class="annottext">t -&gt; Maybe a
</span><a href="#local-6989586621679058579"><span class="hs-identifier hs-var">test</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(t -&gt; String)
-&gt; (SourcePos -&gt; t -&gt; s -&gt; SourcePos)
-&gt; (t -&gt; Maybe a)
-&gt; ParsecT s u Identity a
forall s (m :: * -&gt; *) t a u.
Stream s m t =&gt;
(t -&gt; String)
-&gt; (SourcePos -&gt; t -&gt; s -&gt; SourcePos)
-&gt; (t -&gt; Maybe a)
-&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#tokenPrim"><span class="hs-identifier hs-var">tokenPrim</span></a></span><span> </span><span class="annot"><span class="annottext">t -&gt; String
</span><a href="#local-6989586621679058581"><span class="hs-identifier hs-var">showToken</span></a></span><span> </span><span class="annot"><span class="annottext">SourcePos -&gt; t -&gt; s -&gt; SourcePos
forall {s} {p}. Stream s Identity t =&gt; p -&gt; t -&gt; s -&gt; SourcePos
</span><a href="#local-6989586621679058578"><span class="hs-identifier hs-var">nextpos</span></a></span><span> </span><span class="annot"><span class="annottext">t -&gt; Maybe a
</span><a href="#local-6989586621679058579"><span class="hs-identifier hs-var">test</span></a></span><span>
</span><span id="line-593"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-594"></span><span>        </span><span id="local-6989586621679058578"><span class="annot"><span class="annottext">nextpos :: p -&gt; t -&gt; s -&gt; SourcePos
</span><a href="#local-6989586621679058578"><span class="hs-identifier hs-var hs-var">nextpos</span></a></span></span><span> </span><span class="annot"><span class="annottext">p
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679058575"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058575"><span class="hs-identifier hs-var">tok</span></a></span></span><span> </span><span id="local-6989586621679058574"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058574"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Identity (Maybe (t, s)) -&gt; Maybe (t, s)
forall a. Identity a -&gt; a
</span><a href="../../base/src/Data.Functor.Identity.html#runIdentity"><span class="hs-identifier hs-var hs-var">runIdentity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">s -&gt; Identity (Maybe (t, s))
forall s (m :: * -&gt; *) t. Stream s m t =&gt; s -&gt; m (Maybe (t, s))
</span><a href="Text.Parsec.Prim.html#uncons"><span class="hs-identifier hs-var">uncons</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058574"><span class="hs-identifier hs-var">ts</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-595"></span><span>                             </span><span class="annot"><span class="annottext">Maybe (t, s)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">t -&gt; SourcePos
</span><a href="#local-6989586621679058580"><span class="hs-identifier hs-var">tokpos</span></a></span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058575"><span class="hs-identifier hs-var">tok</span></a></span><span>
</span><span id="line-596"></span><span>                             </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679058572"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058572"><span class="hs-identifier hs-var">tok'</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">s
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">t -&gt; SourcePos
</span><a href="#local-6989586621679058580"><span class="hs-identifier hs-var">tokpos</span></a></span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058572"><span class="hs-identifier hs-var">tok'</span></a></span><span>
</span><span id="line-597"></span><span>
</span><span id="line-598"></span><span class="hs-comment">-- | The parser @tokenPrim showTok nextPos testTok@ accepts a token @t@</span><span>
</span><span id="line-599"></span><span class="hs-comment">-- with result @x@ when the function @testTok t@ returns @'Just' x@. The</span><span>
</span><span id="line-600"></span><span class="hs-comment">-- token can be shown using @showTok t@. The position of the /next/</span><span>
</span><span id="line-601"></span><span class="hs-comment">-- token should be returned when @nextPos@ is called with the current</span><span>
</span><span id="line-602"></span><span class="hs-comment">-- source position @pos@, the current token @t@ and the rest of the</span><span>
</span><span id="line-603"></span><span class="hs-comment">-- tokens @toks@, @nextPos pos t toks@.</span><span>
</span><span id="line-604"></span><span class="hs-comment">--</span><span>
</span><span id="line-605"></span><span class="hs-comment">-- This is the most primitive combinator for accepting tokens. For</span><span>
</span><span id="line-606"></span><span class="hs-comment">-- example, the 'Text.Parsec.Char.char' parser could be implemented as:</span><span>
</span><span id="line-607"></span><span class="hs-comment">--</span><span>
</span><span id="line-608"></span><span class="hs-comment">-- &gt;  char c</span><span>
</span><span id="line-609"></span><span class="hs-comment">-- &gt;    = tokenPrim showChar nextPos testChar</span><span>
</span><span id="line-610"></span><span class="hs-comment">-- &gt;    where</span><span>
</span><span id="line-611"></span><span class="hs-comment">-- &gt;      showChar x        = &quot;'&quot; ++ x ++ &quot;'&quot;</span><span>
</span><span id="line-612"></span><span class="hs-comment">-- &gt;      testChar x        = if x == c then Just x else Nothing</span><span>
</span><span id="line-613"></span><span class="hs-comment">-- &gt;      nextPos pos x xs  = updatePosChar pos x</span><span>
</span><span id="line-614"></span><span>
</span><span id="line-615"></span><span id="local-6989586621679059380"><span id="local-6989586621679059381"><span id="local-6989586621679059382"><span id="local-6989586621679059383"><span id="local-6989586621679059384"><span class="annot"><a href="Text.Parsec.Prim.html#tokenPrim"><span class="hs-identifier hs-type">tokenPrim</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#Stream"><span class="hs-identifier hs-type">Stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059384"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059383"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059382"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-616"></span><span>          </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059382"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span>                      </span><span class="hs-comment">-- ^ Token pretty-printing function.</span><span>
</span><span id="line-617"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059382"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059384"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ Next position calculating function.</span><span>
</span><span id="line-618"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059382"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059381"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>                     </span><span class="hs-comment">-- ^ Matching function for the token to parse.</span><span>
</span><span id="line-619"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059384"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059380"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059383"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059381"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span></span><span>
</span><span id="line-620"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#tokenPrim"><span class="hs-pragma hs-type">tokenPrim</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-621"></span><span id="tokenPrim"><span class="annot"><span class="annottext">tokenPrim :: forall s (m :: * -&gt; *) t a u.
Stream s m t =&gt;
(t -&gt; String)
-&gt; (SourcePos -&gt; t -&gt; s -&gt; SourcePos)
-&gt; (t -&gt; Maybe a)
-&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#tokenPrim"><span class="hs-identifier hs-var hs-var">tokenPrim</span></a></span></span><span> </span><span id="local-6989586621679058569"><span class="annot"><span class="annottext">t -&gt; String
</span><a href="#local-6989586621679058569"><span class="hs-identifier hs-var">showToken</span></a></span></span><span> </span><span id="local-6989586621679058568"><span class="annot"><span class="annottext">SourcePos -&gt; t -&gt; s -&gt; SourcePos
</span><a href="#local-6989586621679058568"><span class="hs-identifier hs-var">nextpos</span></a></span></span><span> </span><span id="local-6989586621679058567"><span class="annot"><span class="annottext">t -&gt; Maybe a
</span><a href="#local-6989586621679058567"><span class="hs-identifier hs-var">test</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(t -&gt; String)
-&gt; (SourcePos -&gt; t -&gt; s -&gt; SourcePos)
-&gt; Maybe (SourcePos -&gt; t -&gt; s -&gt; u -&gt; u)
-&gt; (t -&gt; Maybe a)
-&gt; ParsecT s u m a
forall s (m :: * -&gt; *) t u a.
Stream s m t =&gt;
(t -&gt; String)
-&gt; (SourcePos -&gt; t -&gt; s -&gt; SourcePos)
-&gt; Maybe (SourcePos -&gt; t -&gt; s -&gt; u -&gt; u)
-&gt; (t -&gt; Maybe a)
-&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#tokenPrimEx"><span class="hs-identifier hs-var">tokenPrimEx</span></a></span><span> </span><span class="annot"><span class="annottext">t -&gt; String
</span><a href="#local-6989586621679058569"><span class="hs-identifier hs-var">showToken</span></a></span><span> </span><span class="annot"><span class="annottext">SourcePos -&gt; t -&gt; s -&gt; SourcePos
</span><a href="#local-6989586621679058568"><span class="hs-identifier hs-var">nextpos</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (SourcePos -&gt; t -&gt; s -&gt; u -&gt; u)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">t -&gt; Maybe a
</span><a href="#local-6989586621679058567"><span class="hs-identifier hs-var">test</span></a></span><span>
</span><span id="line-622"></span><span>
</span><span id="line-623"></span><span id="local-6989586621679059367"><span id="local-6989586621679059368"><span id="local-6989586621679059369"><span id="local-6989586621679059370"><span id="local-6989586621679059371"><span class="annot"><a href="Text.Parsec.Prim.html#tokenPrimEx"><span class="hs-identifier hs-type">tokenPrimEx</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#Stream"><span class="hs-identifier hs-type">Stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059371"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059370"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059369"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-624"></span><span>            </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059369"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-625"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059369"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059371"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-626"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059369"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059371"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059368"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059368"><span class="hs-identifier hs-type">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-627"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059369"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059367"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-628"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059371"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059368"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059370"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059367"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span></span><span>
</span><span id="line-629"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#tokenPrimEx"><span class="hs-pragma hs-type">tokenPrimEx</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-630"></span><span id="tokenPrimEx"><span class="annot"><span class="annottext">tokenPrimEx :: forall s (m :: * -&gt; *) t u a.
Stream s m t =&gt;
(t -&gt; String)
-&gt; (SourcePos -&gt; t -&gt; s -&gt; SourcePos)
-&gt; Maybe (SourcePos -&gt; t -&gt; s -&gt; u -&gt; u)
-&gt; (t -&gt; Maybe a)
-&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#tokenPrimEx"><span class="hs-identifier hs-var hs-var">tokenPrimEx</span></a></span></span><span> </span><span id="local-6989586621679058564"><span class="annot"><span class="annottext">t -&gt; String
</span><a href="#local-6989586621679058564"><span class="hs-identifier hs-var">showToken</span></a></span></span><span> </span><span id="local-6989586621679058563"><span class="annot"><span class="annottext">SourcePos -&gt; t -&gt; s -&gt; SourcePos
</span><a href="#local-6989586621679058563"><span class="hs-identifier hs-var">nextpos</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe (SourcePos -&gt; t -&gt; s -&gt; u -&gt; u)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span id="local-6989586621679058562"><span class="annot"><span class="annottext">t -&gt; Maybe a
</span><a href="#local-6989586621679058562"><span class="hs-identifier hs-var">test</span></a></span></span><span>
</span><span id="line-631"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
forall s u (m :: * -&gt; *) a.
(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-var">ParsecT</span></a></span><span> </span><span class="annot"><span class="annottext">((forall b.
  State s u
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; m b)
 -&gt; ParsecT s u m a)
-&gt; (forall b.
    State s u
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; m b)
-&gt; ParsecT s u m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span id="local-6989586621679058559"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058559"><span class="hs-identifier hs-var">input</span></a></span></span><span> </span><span id="local-6989586621679058558"><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058558"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span id="local-6989586621679058557"><span class="annot"><span class="annottext">u
</span><a href="#local-6989586621679058557"><span class="hs-identifier hs-var">user</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679058556"><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058556"><span class="hs-identifier hs-var">cok</span></a></span></span><span> </span><span id="local-6989586621679058555"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058555"><span class="hs-identifier hs-var">_cerr</span></a></span></span><span> </span><span id="local-6989586621679058554"><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058554"><span class="hs-identifier hs-var">_eok</span></a></span></span><span> </span><span id="local-6989586621679058553"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058553"><span class="hs-identifier hs-var">eerr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-632"></span><span>      </span><span id="local-6989586621679058552"><span class="annot"><span class="annottext">Maybe (t, s)
</span><a href="#local-6989586621679058552"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">s -&gt; m (Maybe (t, s))
forall s (m :: * -&gt; *) t. Stream s m t =&gt; s -&gt; m (Maybe (t, s))
</span><a href="Text.Parsec.Prim.html#uncons"><span class="hs-identifier hs-var">uncons</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058559"><span class="hs-identifier hs-var">input</span></a></span><span>
</span><span id="line-633"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (t, s)
</span><a href="#local-6989586621679058552"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-634"></span><span>        </span><span class="annot"><span class="annottext">Maybe (t, s)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058553"><span class="hs-identifier hs-var">eerr</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseError -&gt; m b) -&gt; ParseError -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SourcePos -&gt; ParseError
</span><a href="Text.Parsec.Prim.html#unexpectError"><span class="hs-identifier hs-var">unexpectError</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058558"><span class="hs-identifier hs-var">pos</span></a></span><span>
</span><span id="line-635"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679058550"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058550"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679058549"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058549"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-636"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">t -&gt; Maybe a
</span><a href="#local-6989586621679058562"><span class="hs-identifier hs-var">test</span></a></span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058550"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-637"></span><span>              </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679058548"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058548"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679058547"><span class="annot"><span class="annottext">newpos :: SourcePos
</span><a href="#local-6989586621679058547"><span class="hs-identifier hs-var hs-var">newpos</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SourcePos -&gt; t -&gt; s -&gt; SourcePos
</span><a href="#local-6989586621679058563"><span class="hs-identifier hs-var">nextpos</span></a></span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058558"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058550"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058549"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-638"></span><span>                            </span><span id="local-6989586621679058546"><span class="annot"><span class="annottext">newstate :: State s u
</span><a href="#local-6989586621679058546"><span class="hs-identifier hs-var hs-var">newstate</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">s -&gt; SourcePos -&gt; u -&gt; State s u
forall s u. s -&gt; SourcePos -&gt; u -&gt; State s u
</span><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-var">State</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058549"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058547"><span class="hs-identifier hs-var">newpos</span></a></span><span> </span><span class="annot"><span class="annottext">u
</span><a href="#local-6989586621679058557"><span class="hs-identifier hs-var">user</span></a></span><span>
</span><span id="line-639"></span><span>                        </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">SourcePos -&gt; m b -&gt; m b
</span><span class="hs-identifier hs-var">seq</span></span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058547"><span class="hs-identifier hs-var">newpos</span></a></span><span> </span><span class="annot"><span class="annottext">(m b -&gt; m b) -&gt; m b -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">State s u -&gt; m b -&gt; m b
</span><span class="hs-identifier hs-var">seq</span></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058546"><span class="hs-identifier hs-var">newstate</span></a></span><span> </span><span class="annot"><span class="annottext">(m b -&gt; m b) -&gt; m b -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-640"></span><span>                           </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058556"><span class="hs-identifier hs-var">cok</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058548"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058546"><span class="hs-identifier hs-var">newstate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SourcePos -&gt; ParseError
</span><a href="Text.Parsec.Error.html#newErrorUnknown"><span class="hs-identifier hs-var">newErrorUnknown</span></a></span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058547"><span class="hs-identifier hs-var">newpos</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-641"></span><span>              </span><span class="annot"><span class="annottext">Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058553"><span class="hs-identifier hs-var">eerr</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseError -&gt; m b) -&gt; ParseError -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SourcePos -&gt; ParseError
</span><a href="Text.Parsec.Prim.html#unexpectError"><span class="hs-identifier hs-var">unexpectError</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">t -&gt; String
</span><a href="#local-6989586621679058564"><span class="hs-identifier hs-var">showToken</span></a></span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058550"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058558"><span class="hs-identifier hs-var">pos</span></a></span><span>
</span><span id="line-642"></span><span class="annot"><a href="Text.Parsec.Prim.html#tokenPrimEx"><span class="hs-identifier hs-var">tokenPrimEx</span></a></span><span> </span><span id="local-6989586621679058545"><span class="annot"><span class="annottext">t -&gt; String
</span><a href="#local-6989586621679058545"><span class="hs-identifier hs-var">showToken</span></a></span></span><span> </span><span id="local-6989586621679058544"><span class="annot"><span class="annottext">SourcePos -&gt; t -&gt; s -&gt; SourcePos
</span><a href="#local-6989586621679058544"><span class="hs-identifier hs-var">nextpos</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679058543"><span class="annot"><span class="annottext">SourcePos -&gt; t -&gt; s -&gt; u -&gt; u
</span><a href="#local-6989586621679058543"><span class="hs-identifier hs-var">nextState</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679058542"><span class="annot"><span class="annottext">t -&gt; Maybe a
</span><a href="#local-6989586621679058542"><span class="hs-identifier hs-var">test</span></a></span></span><span>
</span><span id="line-643"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
forall s u (m :: * -&gt; *) a.
(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-var">ParsecT</span></a></span><span> </span><span class="annot"><span class="annottext">((forall b.
  State s u
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; m b)
 -&gt; ParsecT s u m a)
-&gt; (forall b.
    State s u
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; m b)
-&gt; ParsecT s u m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span id="local-6989586621679058539"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058539"><span class="hs-identifier hs-var">input</span></a></span></span><span> </span><span id="local-6989586621679058538"><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058538"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span id="local-6989586621679058537"><span class="annot"><span class="annottext">u
</span><a href="#local-6989586621679058537"><span class="hs-identifier hs-var">user</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679058536"><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058536"><span class="hs-identifier hs-var">cok</span></a></span></span><span> </span><span id="local-6989586621679058535"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058535"><span class="hs-identifier hs-var">_cerr</span></a></span></span><span> </span><span id="local-6989586621679058534"><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058534"><span class="hs-identifier hs-var">_eok</span></a></span></span><span> </span><span id="local-6989586621679058533"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058533"><span class="hs-identifier hs-var">eerr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-644"></span><span>      </span><span id="local-6989586621679058532"><span class="annot"><span class="annottext">Maybe (t, s)
</span><a href="#local-6989586621679058532"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">s -&gt; m (Maybe (t, s))
forall s (m :: * -&gt; *) t. Stream s m t =&gt; s -&gt; m (Maybe (t, s))
</span><a href="Text.Parsec.Prim.html#uncons"><span class="hs-identifier hs-var">uncons</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058539"><span class="hs-identifier hs-var">input</span></a></span><span>
</span><span id="line-645"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (t, s)
</span><a href="#local-6989586621679058532"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-646"></span><span>        </span><span class="annot"><span class="annottext">Maybe (t, s)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058533"><span class="hs-identifier hs-var">eerr</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseError -&gt; m b) -&gt; ParseError -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SourcePos -&gt; ParseError
</span><a href="Text.Parsec.Prim.html#unexpectError"><span class="hs-identifier hs-var">unexpectError</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058538"><span class="hs-identifier hs-var">pos</span></a></span><span>
</span><span id="line-647"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679058531"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058531"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679058530"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058530"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-648"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">t -&gt; Maybe a
</span><a href="#local-6989586621679058542"><span class="hs-identifier hs-var">test</span></a></span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058531"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-649"></span><span>              </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679058529"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058529"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679058528"><span class="annot"><span class="annottext">newpos :: SourcePos
</span><a href="#local-6989586621679058528"><span class="hs-identifier hs-var hs-var">newpos</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SourcePos -&gt; t -&gt; s -&gt; SourcePos
</span><a href="#local-6989586621679058544"><span class="hs-identifier hs-var">nextpos</span></a></span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058538"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058531"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058530"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-650"></span><span>                            </span><span id="local-6989586621679058527"><span class="annot"><span class="annottext">newUser :: u
</span><a href="#local-6989586621679058527"><span class="hs-identifier hs-var hs-var">newUser</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SourcePos -&gt; t -&gt; s -&gt; u -&gt; u
</span><a href="#local-6989586621679058543"><span class="hs-identifier hs-var">nextState</span></a></span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058538"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058531"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058530"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">u
</span><a href="#local-6989586621679058537"><span class="hs-identifier hs-var">user</span></a></span><span>
</span><span id="line-651"></span><span>                            </span><span id="local-6989586621679058526"><span class="annot"><span class="annottext">newstate :: State s u
</span><a href="#local-6989586621679058526"><span class="hs-identifier hs-var hs-var">newstate</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">s -&gt; SourcePos -&gt; u -&gt; State s u
forall s u. s -&gt; SourcePos -&gt; u -&gt; State s u
</span><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-var">State</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058530"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058528"><span class="hs-identifier hs-var">newpos</span></a></span><span> </span><span class="annot"><span class="annottext">u
</span><a href="#local-6989586621679058527"><span class="hs-identifier hs-var">newUser</span></a></span><span>
</span><span id="line-652"></span><span>                        </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">SourcePos -&gt; m b -&gt; m b
</span><span class="hs-identifier hs-var">seq</span></span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058528"><span class="hs-identifier hs-var">newpos</span></a></span><span> </span><span class="annot"><span class="annottext">(m b -&gt; m b) -&gt; m b -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">State s u -&gt; m b -&gt; m b
</span><span class="hs-identifier hs-var">seq</span></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058526"><span class="hs-identifier hs-var">newstate</span></a></span><span> </span><span class="annot"><span class="annottext">(m b -&gt; m b) -&gt; m b -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-653"></span><span>                           </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058536"><span class="hs-identifier hs-var">cok</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058529"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058526"><span class="hs-identifier hs-var">newstate</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseError -&gt; m b) -&gt; ParseError -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SourcePos -&gt; ParseError
</span><a href="Text.Parsec.Error.html#newErrorUnknown"><span class="hs-identifier hs-var">newErrorUnknown</span></a></span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058528"><span class="hs-identifier hs-var">newpos</span></a></span><span>
</span><span id="line-654"></span><span>              </span><span class="annot"><span class="annottext">Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058533"><span class="hs-identifier hs-var">eerr</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseError -&gt; m b) -&gt; ParseError -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SourcePos -&gt; ParseError
</span><a href="Text.Parsec.Prim.html#unexpectError"><span class="hs-identifier hs-var">unexpectError</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">t -&gt; String
</span><a href="#local-6989586621679058545"><span class="hs-identifier hs-var">showToken</span></a></span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679058531"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058538"><span class="hs-identifier hs-var">pos</span></a></span><span>
</span><span id="line-655"></span><span>
</span><span id="line-656"></span><span class="annot"><a href="Text.Parsec.Prim.html#unexpectError"><span class="hs-identifier hs-type">unexpectError</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Error.html#ParseError"><span class="hs-identifier hs-type">ParseError</span></a></span><span>
</span><span id="line-657"></span><span id="unexpectError"><span class="annot"><span class="annottext">unexpectError :: String -&gt; SourcePos -&gt; ParseError
</span><a href="Text.Parsec.Prim.html#unexpectError"><span class="hs-identifier hs-var hs-var">unexpectError</span></a></span></span><span> </span><span id="local-6989586621679058525"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679058525"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span id="local-6989586621679058524"><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058524"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Message -&gt; SourcePos -&gt; ParseError
</span><a href="Text.Parsec.Error.html#newErrorMessage"><span class="hs-identifier hs-var">newErrorMessage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Message
</span><a href="Text.Parsec.Error.html#SysUnExpect"><span class="hs-identifier hs-var">SysUnExpect</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679058525"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058524"><span class="hs-identifier hs-var">pos</span></a></span><span>
</span><span id="line-658"></span><span>
</span><span id="line-659"></span><span>
</span><span id="line-660"></span><span class="hs-comment">-- | @many p@ applies the parser @p@ /zero/ or more times. Returns a</span><span>
</span><span id="line-661"></span><span class="hs-comment">--    list of the returned values of @p@.</span><span>
</span><span id="line-662"></span><span class="hs-comment">--</span><span>
</span><span id="line-663"></span><span class="hs-comment">-- &gt;  identifier  = do{ c  &lt;- letter</span><span>
</span><span id="line-664"></span><span class="hs-comment">-- &gt;                  ; cs &lt;- many (alphaNum &lt;|&gt; char '_')</span><span>
</span><span id="line-665"></span><span class="hs-comment">-- &gt;                  ; return (c:cs)</span><span>
</span><span id="line-666"></span><span class="hs-comment">-- &gt;                  }</span><span>
</span><span id="line-667"></span><span>
</span><span id="line-668"></span><span id="local-6989586621679058520"><span id="local-6989586621679058521"><span id="local-6989586621679058522"><span id="local-6989586621679058523"><span class="annot"><a href="Text.Parsec.Prim.html#many"><span class="hs-identifier hs-type">many</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058523"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058522"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058521"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058520"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058523"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058522"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058521"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679058520"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span></span></span></span><span>
</span><span id="line-669"></span><span id="many"><span class="annot"><span class="annottext">many :: forall s u (m :: * -&gt; *) a. ParsecT s u m a -&gt; ParsecT s u m [a]
</span><a href="Text.Parsec.Prim.html#many"><span class="hs-identifier hs-var hs-var">many</span></a></span></span><span> </span><span id="local-6989586621679058517"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058517"><span class="hs-identifier hs-var">p</span></a></span></span><span>
</span><span id="line-670"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679058516"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679058516"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(a -&gt; [a] -&gt; [a]) -&gt; ParsecT s u m a -&gt; ParsecT s u m [a]
forall a s u (m :: * -&gt; *).
(a -&gt; [a] -&gt; [a]) -&gt; ParsecT s u m a -&gt; ParsecT s u m [a]
</span><a href="Text.Parsec.Prim.html#manyAccum"><span class="hs-identifier hs-var">manyAccum</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">:</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058517"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-671"></span><span>       </span><span class="annot"><span class="annottext">[a] -&gt; ParsecT s u m [a]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[a] -&gt; [a]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679058516"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-672"></span><span>
</span><span id="line-673"></span><span class="hs-comment">-- | @skipMany p@ applies the parser @p@ /zero/ or more times, skipping</span><span>
</span><span id="line-674"></span><span class="hs-comment">-- its result.</span><span>
</span><span id="line-675"></span><span class="hs-comment">--</span><span>
</span><span id="line-676"></span><span class="hs-comment">-- &gt;  spaces  = skipMany space</span><span>
</span><span id="line-677"></span><span>
</span><span id="line-678"></span><span id="local-6989586621679059345"><span id="local-6989586621679059346"><span id="local-6989586621679059347"><span id="local-6989586621679059348"><span class="annot"><a href="Text.Parsec.Prim.html#skipMany"><span class="hs-identifier hs-type">skipMany</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059348"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059347"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059346"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059345"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059348"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059347"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059346"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span></span></span></span><span>
</span><span id="line-679"></span><span id="skipMany"><span class="annot"><span class="annottext">skipMany :: forall s u (m :: * -&gt; *) a. ParsecT s u m a -&gt; ParsecT s u m ()
</span><a href="Text.Parsec.Prim.html#skipMany"><span class="hs-identifier hs-var hs-var">skipMany</span></a></span></span><span> </span><span id="local-6989586621679058512"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058512"><span class="hs-identifier hs-var">p</span></a></span></span><span>
</span><span id="line-680"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">[a]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(a -&gt; [a] -&gt; [a]) -&gt; ParsecT s u m a -&gt; ParsecT s u m [a]
forall a s u (m :: * -&gt; *).
(a -&gt; [a] -&gt; [a]) -&gt; ParsecT s u m a -&gt; ParsecT s u m [a]
</span><a href="Text.Parsec.Prim.html#manyAccum"><span class="hs-identifier hs-var">manyAccum</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[a]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058512"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-681"></span><span>       </span><span class="annot"><span class="annottext">() -&gt; ParsecT s u m ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-682"></span><span>
</span><span id="line-683"></span><span id="local-6989586621679059350"><span id="local-6989586621679059351"><span id="local-6989586621679059352"><span id="local-6989586621679059353"><span class="annot"><a href="Text.Parsec.Prim.html#manyAccum"><span class="hs-identifier hs-type">manyAccum</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059353"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679059353"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679059353"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-684"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059352"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059351"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059350"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059353"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-685"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059352"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059351"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059350"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679059353"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span></span></span></span><span>
</span><span id="line-686"></span><span id="manyAccum"><span class="annot"><span class="annottext">manyAccum :: forall a s u (m :: * -&gt; *).
(a -&gt; [a] -&gt; [a]) -&gt; ParsecT s u m a -&gt; ParsecT s u m [a]
</span><a href="Text.Parsec.Prim.html#manyAccum"><span class="hs-identifier hs-var hs-var">manyAccum</span></a></span></span><span> </span><span id="local-6989586621679058511"><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
</span><a href="#local-6989586621679058511"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span id="local-6989586621679058510"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058510"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-687"></span><span>    </span><span class="annot"><span class="annottext">(forall b.
 State s u
 -&gt; ([a] -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; ([a] -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m [a]
forall s u (m :: * -&gt; *) a.
(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-var">ParsecT</span></a></span><span> </span><span class="annot"><span class="annottext">((forall b.
  State s u
  -&gt; ([a] -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; ([a] -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; m b)
 -&gt; ParsecT s u m [a])
-&gt; (forall b.
    State s u
    -&gt; ([a] -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; ([a] -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; m b)
-&gt; ParsecT s u m [a]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679058509"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058509"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679058508"><span class="annot"><span class="annottext">[a] -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058508"><span class="hs-identifier hs-var">cok</span></a></span></span><span> </span><span id="local-6989586621679058507"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058507"><span class="hs-identifier hs-var">cerr</span></a></span></span><span> </span><span id="local-6989586621679058506"><span class="annot"><span class="annottext">[a] -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058506"><span class="hs-identifier hs-var">eok</span></a></span></span><span> </span><span id="local-6989586621679058505"><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058505"><span class="hs-identifier hs-var">_eerr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-688"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679058504"><span class="annot"><span class="annottext">walk :: [a] -&gt; a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058504"><span class="hs-identifier hs-var hs-var">walk</span></a></span></span><span> </span><span id="local-6989586621679058503"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679058503"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679058502"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058502"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679058501"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058501"><span class="hs-identifier hs-var">s'</span></a></span></span><span> </span><span id="local-6989586621679058500"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058500"><span class="hs-identifier hs-var">_err</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-689"></span><span>            </span><span class="annot"><span class="annottext">ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
forall s u (m :: * -&gt; *) a.
ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
</span><a href="Text.Parsec.Prim.html#unParser"><span class="hs-identifier hs-var hs-var">unParser</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058510"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058501"><span class="hs-identifier hs-var">s'</span></a></span><span>
</span><span id="line-690"></span><span>              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[a]
-&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
-&gt; a
-&gt; State s u
-&gt; ParseError
-&gt; m b
</span><span class="hs-identifier hs-var">seq</span></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679058503"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">((a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; a -&gt; State s u -&gt; ParseError -&gt; m b)
-&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
-&gt; a
-&gt; State s u
-&gt; ParseError
-&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058504"><span class="hs-identifier hs-var">walk</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; a -&gt; State s u -&gt; ParseError -&gt; m b)
-&gt; [a] -&gt; a -&gt; State s u -&gt; ParseError -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
</span><a href="#local-6989586621679058511"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058502"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679058503"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- consumed-ok</span><span>
</span><span id="line-691"></span><span>              </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058507"><span class="hs-identifier hs-var">cerr</span></a></span><span>                        </span><span class="hs-comment">-- consumed-err</span><span>
</span><span id="line-692"></span><span>              </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
forall a. a
</span><a href="Text.Parsec.Prim.html#manyErr"><span class="hs-identifier hs-var">manyErr</span></a></span><span>                     </span><span class="hs-comment">-- empty-ok</span><span>
</span><span id="line-693"></span><span>              </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679058498"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058498"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058508"><span class="hs-identifier hs-var">cok</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
</span><a href="#local-6989586621679058511"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058502"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679058503"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058501"><span class="hs-identifier hs-var">s'</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058498"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- empty-err</span><span>
</span><span id="line-694"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
forall s u (m :: * -&gt; *) a.
ParsecT s u m a
-&gt; forall b.
   State s u
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
   -&gt; (ParseError -&gt; m b)
   -&gt; m b
</span><a href="Text.Parsec.Prim.html#unParser"><span class="hs-identifier hs-var hs-var">unParser</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058510"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058509"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[a] -&gt; a -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058504"><span class="hs-identifier hs-var">walk</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><a href="#local-6989586621679058507"><span class="hs-identifier hs-var">cerr</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; State s u -&gt; ParseError -&gt; m b
forall a. a
</span><a href="Text.Parsec.Prim.html#manyErr"><span class="hs-identifier hs-var">manyErr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679058497"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058497"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058506"><span class="hs-identifier hs-var">eok</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058509"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058497"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-695"></span><span>
</span><span id="line-696"></span><span id="local-6989586621679059335"><span class="annot"><a href="Text.Parsec.Prim.html#manyErr"><span class="hs-identifier hs-type">manyErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679059335"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-697"></span><span id="manyErr"><span class="annot"><span class="annottext">manyErr :: forall a. a
</span><a href="Text.Parsec.Prim.html#manyErr"><span class="hs-identifier hs-var hs-var">manyErr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Text.ParserCombinators.Parsec.Prim.many: combinator 'many' is applied to a parser that accepts an empty string.&quot;</span></span><span>
</span><span id="line-698"></span><span>
</span><span id="line-699"></span><span>
</span><span id="line-700"></span><span class="hs-comment">-- &lt; Running a parser: monadic (runPT) and pure (runP)</span><span>
</span><span id="line-701"></span><span>
</span><span id="line-702"></span><span id="local-6989586621679059326"><span id="local-6989586621679059327"><span id="local-6989586621679059328"><span id="local-6989586621679059329"><span id="local-6989586621679059330"><span class="annot"><a href="Text.Parsec.Prim.html#runPT"><span class="hs-identifier hs-type">runPT</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#Stream"><span class="hs-identifier hs-type">Stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059330"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059329"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059328"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-703"></span><span>      </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059330"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059327"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059329"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059326"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059327"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourceName"><span class="hs-identifier hs-type">SourceName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059330"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059329"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="Text.Parsec.Error.html#ParseError"><span class="hs-identifier hs-type">ParseError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059326"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span></span></span></span><span>
</span><span id="line-704"></span><span class="hs-pragma">{-# INLINABLE</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#runPT"><span class="hs-pragma hs-type">runPT</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-705"></span><span id="runPT"><span class="annot"><span class="annottext">runPT :: forall s (m :: * -&gt; *) t u a.
Stream s m t =&gt;
ParsecT s u m a -&gt; u -&gt; String -&gt; s -&gt; m (Either ParseError a)
</span><a href="Text.Parsec.Prim.html#runPT"><span class="hs-identifier hs-var hs-var">runPT</span></a></span></span><span> </span><span id="local-6989586621679058485"><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058485"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679058484"><span class="annot"><span class="annottext">u
</span><a href="#local-6989586621679058484"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621679058483"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679058483"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621679058482"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058482"><span class="hs-identifier hs-var">s</span></a></span></span><span>
</span><span id="line-706"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679058481"><span class="annot"><span class="annottext">Consumed (m (Reply s u a))
</span><a href="#local-6989586621679058481"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a -&gt; State s u -&gt; m (Consumed (m (Reply s u a)))
forall (m :: * -&gt; *) s u a.
Monad m =&gt;
ParsecT s u m a -&gt; State s u -&gt; m (Consumed (m (Reply s u a)))
</span><a href="Text.Parsec.Prim.html#runParsecT"><span class="hs-identifier hs-var">runParsecT</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a
</span><a href="#local-6989586621679058485"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">s -&gt; SourcePos -&gt; u -&gt; State s u
forall s u. s -&gt; SourcePos -&gt; u -&gt; State s u
</span><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-var">State</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058482"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SourcePos
</span><a href="Text.Parsec.Pos.html#initialPos"><span class="hs-identifier hs-var">initialPos</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679058483"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">u
</span><a href="#local-6989586621679058484"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-707"></span><span>         </span><span id="local-6989586621679058479"><span class="annot"><span class="annottext">Reply s u a
</span><a href="#local-6989586621679058479"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Consumed (m (Reply s u a)) -&gt; m (Reply s u a)
forall {a}. Consumed a -&gt; a
</span><a href="#local-6989586621679058478"><span class="hs-identifier hs-var">parserReply</span></a></span><span> </span><span class="annot"><span class="annottext">Consumed (m (Reply s u a))
</span><a href="#local-6989586621679058481"><span class="hs-identifier hs-var">res</span></a></span><span>
</span><span id="line-708"></span><span>         </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Reply s u a
</span><a href="#local-6989586621679058479"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-709"></span><span>           </span><span class="annot"><a href="Text.Parsec.Prim.html#Ok"><span class="hs-identifier hs-type">Ok</span></a></span><span> </span><span id="local-6989586621679058477"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058477"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="annot"><span class="annottext">State s u
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Either ParseError a -&gt; m (Either ParseError a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Either ParseError a
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058477"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-710"></span><span>           </span><span class="annot"><a href="Text.Parsec.Prim.html#Error"><span class="hs-identifier hs-type">Error</span></a></span><span> </span><span id="local-6989586621679058476"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058476"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Either ParseError a -&gt; m (Either ParseError a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ParseError -&gt; Either ParseError a
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058476"><span class="hs-identifier hs-var">err</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-711"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-712"></span><span>        </span><span id="local-6989586621679058478"><span class="annot"><span class="annottext">parserReply :: Consumed a -&gt; a
</span><a href="#local-6989586621679058478"><span class="hs-identifier hs-var hs-var">parserReply</span></a></span></span><span> </span><span id="local-6989586621679058475"><span class="annot"><span class="annottext">Consumed a
</span><a href="#local-6989586621679058475"><span class="hs-identifier hs-var">res</span></a></span></span><span>
</span><span id="line-713"></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Consumed a
</span><a href="#local-6989586621679058475"><span class="hs-identifier hs-var">res</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-714"></span><span>                </span><span class="annot"><a href="Text.Parsec.Prim.html#Consumed"><span class="hs-identifier hs-type">Consumed</span></a></span><span> </span><span id="local-6989586621679058474"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058474"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058474"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-715"></span><span>                </span><span class="annot"><a href="Text.Parsec.Prim.html#Empty"><span class="hs-identifier hs-type">Empty</span></a></span><span>    </span><span id="local-6989586621679058473"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058473"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058473"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-716"></span><span>
</span><span id="line-717"></span><span id="local-6989586621679059314"><span id="local-6989586621679059315"><span id="local-6989586621679059316"><span id="local-6989586621679059317"><span class="annot"><a href="Text.Parsec.Prim.html#runP"><span class="hs-identifier hs-type">runP</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#Stream"><span class="hs-identifier hs-type">Stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059317"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Identity.html#Identity"><span class="hs-identifier hs-type">Identity</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059316"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-718"></span><span>     </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#Parsec"><span class="hs-identifier hs-type">Parsec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059317"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059315"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059314"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059315"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourceName"><span class="hs-identifier hs-type">SourceName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059317"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="Text.Parsec.Error.html#ParseError"><span class="hs-identifier hs-type">ParseError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059314"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span><span>
</span><span id="line-719"></span><span id="runP"><span class="annot"><span class="annottext">runP :: forall s t u a.
Stream s Identity t =&gt;
Parsec s u a -&gt; u -&gt; String -&gt; s -&gt; Either ParseError a
</span><a href="Text.Parsec.Prim.html#runP"><span class="hs-identifier hs-var hs-var">runP</span></a></span></span><span> </span><span id="local-6989586621679058470"><span class="annot"><span class="annottext">Parsec s u a
</span><a href="#local-6989586621679058470"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679058469"><span class="annot"><span class="annottext">u
</span><a href="#local-6989586621679058469"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621679058468"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679058468"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621679058467"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058467"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Identity (Either ParseError a) -&gt; Either ParseError a
forall a. Identity a -&gt; a
</span><a href="../../base/src/Data.Functor.Identity.html#runIdentity"><span class="hs-identifier hs-var hs-var">runIdentity</span></a></span><span> </span><span class="annot"><span class="annottext">(Identity (Either ParseError a) -&gt; Either ParseError a)
-&gt; Identity (Either ParseError a) -&gt; Either ParseError a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Parsec s u a -&gt; u -&gt; String -&gt; s -&gt; Identity (Either ParseError a)
forall s (m :: * -&gt; *) t u a.
Stream s m t =&gt;
ParsecT s u m a -&gt; u -&gt; String -&gt; s -&gt; m (Either ParseError a)
</span><a href="Text.Parsec.Prim.html#runPT"><span class="hs-identifier hs-var">runPT</span></a></span><span> </span><span class="annot"><span class="annottext">Parsec s u a
</span><a href="#local-6989586621679058470"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">u
</span><a href="#local-6989586621679058469"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679058468"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058467"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-720"></span><span>
</span><span id="line-721"></span><span class="hs-comment">-- | The most general way to run a parser. @runParserT p state filePath</span><span>
</span><span id="line-722"></span><span class="hs-comment">-- input@ runs parser @p@ on the input list of tokens @input@,</span><span>
</span><span id="line-723"></span><span class="hs-comment">-- obtained from source @filePath@ with the initial user state @st@.</span><span>
</span><span id="line-724"></span><span class="hs-comment">-- The @filePath@ is only used in error messages and may be the empty</span><span>
</span><span id="line-725"></span><span class="hs-comment">-- string. Returns a computation in the underlying monad @m@ that return either a 'ParseError' ('Left') or a</span><span>
</span><span id="line-726"></span><span class="hs-comment">-- value of type @a@ ('Right').</span><span>
</span><span id="line-727"></span><span>
</span><span id="line-728"></span><span id="local-6989586621679058462"><span id="local-6989586621679058463"><span id="local-6989586621679058464"><span id="local-6989586621679058465"><span id="local-6989586621679058466"><span class="annot"><a href="Text.Parsec.Prim.html#runParserT"><span class="hs-identifier hs-type">runParserT</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#Stream"><span class="hs-identifier hs-type">Stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058466"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058465"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058464"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-729"></span><span>           </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058466"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058463"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058465"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058462"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679058463"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourceName"><span class="hs-identifier hs-type">SourceName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679058466"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679058465"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="Text.Parsec.Error.html#ParseError"><span class="hs-identifier hs-type">ParseError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058462"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span></span></span></span><span>
</span><span id="line-730"></span><span id="runParserT"><span class="annot"><span class="annottext">runParserT :: forall s (m :: * -&gt; *) t u a.
Stream s m t =&gt;
ParsecT s u m a -&gt; u -&gt; String -&gt; s -&gt; m (Either ParseError a)
</span><a href="Text.Parsec.Prim.html#runParserT"><span class="hs-identifier hs-var hs-var">runParserT</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m a -&gt; u -&gt; String -&gt; s -&gt; m (Either ParseError a)
forall s (m :: * -&gt; *) t u a.
Stream s m t =&gt;
ParsecT s u m a -&gt; u -&gt; String -&gt; s -&gt; m (Either ParseError a)
</span><a href="Text.Parsec.Prim.html#runPT"><span class="hs-identifier hs-var">runPT</span></a></span><span>
</span><span id="line-731"></span><span>
</span><span id="line-732"></span><span class="hs-comment">-- | The most general way to run a parser over the Identity monad. @runParser p state filePath</span><span>
</span><span id="line-733"></span><span class="hs-comment">-- input@ runs parser @p@ on the input list of tokens @input@,</span><span>
</span><span id="line-734"></span><span class="hs-comment">-- obtained from source @filePath@ with the initial user state @st@.</span><span>
</span><span id="line-735"></span><span class="hs-comment">-- The @filePath@ is only used in error messages and may be the empty</span><span>
</span><span id="line-736"></span><span class="hs-comment">-- string. Returns either a 'ParseError' ('Left') or a</span><span>
</span><span id="line-737"></span><span class="hs-comment">-- value of type @a@ ('Right').</span><span>
</span><span id="line-738"></span><span class="hs-comment">--</span><span>
</span><span id="line-739"></span><span class="hs-comment">-- &gt;  parseFromFile p fname</span><span>
</span><span id="line-740"></span><span class="hs-comment">-- &gt;    = do{ input &lt;- readFile fname</span><span>
</span><span id="line-741"></span><span class="hs-comment">-- &gt;        ; return (runParser p () fname input)</span><span>
</span><span id="line-742"></span><span class="hs-comment">-- &gt;        }</span><span>
</span><span id="line-743"></span><span>
</span><span id="line-744"></span><span id="local-6989586621679058456"><span id="local-6989586621679058457"><span id="local-6989586621679058458"><span id="local-6989586621679058459"><span class="annot"><a href="Text.Parsec.Prim.html#runParser"><span class="hs-identifier hs-type">runParser</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#Stream"><span class="hs-identifier hs-type">Stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058459"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Identity.html#Identity"><span class="hs-identifier hs-type">Identity</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058458"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-745"></span><span>          </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#Parsec"><span class="hs-identifier hs-type">Parsec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058459"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058457"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058456"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679058457"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourceName"><span class="hs-identifier hs-type">SourceName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679058459"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="Text.Parsec.Error.html#ParseError"><span class="hs-identifier hs-type">ParseError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058456"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span><span>
</span><span id="line-746"></span><span id="runParser"><span class="annot"><span class="annottext">runParser :: forall s t u a.
Stream s Identity t =&gt;
Parsec s u a -&gt; u -&gt; String -&gt; s -&gt; Either ParseError a
</span><a href="Text.Parsec.Prim.html#runParser"><span class="hs-identifier hs-var hs-var">runParser</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Parsec s u a -&gt; u -&gt; String -&gt; s -&gt; Either ParseError a
forall s t u a.
Stream s Identity t =&gt;
Parsec s u a -&gt; u -&gt; String -&gt; s -&gt; Either ParseError a
</span><a href="Text.Parsec.Prim.html#runP"><span class="hs-identifier hs-var">runP</span></a></span><span>
</span><span id="line-747"></span><span>
</span><span id="line-748"></span><span class="hs-comment">-- | @parse p filePath input@ runs a parser @p@ over Identity without user</span><span>
</span><span id="line-749"></span><span class="hs-comment">-- state. The @filePath@ is only used in error messages and may be the</span><span>
</span><span id="line-750"></span><span class="hs-comment">-- empty string. Returns either a 'ParseError' ('Left')</span><span>
</span><span id="line-751"></span><span class="hs-comment">-- or a value of type @a@ ('Right').</span><span>
</span><span id="line-752"></span><span class="hs-comment">--</span><span>
</span><span id="line-753"></span><span class="hs-comment">-- &gt;  main    = case (parse numbers &quot;&quot; &quot;11, 2, 43&quot;) of</span><span>
</span><span id="line-754"></span><span class="hs-comment">-- &gt;             Left err  -&gt; print err</span><span>
</span><span id="line-755"></span><span class="hs-comment">-- &gt;             Right xs  -&gt; print (sum xs)</span><span>
</span><span id="line-756"></span><span class="hs-comment">-- &gt;</span><span>
</span><span id="line-757"></span><span class="hs-comment">-- &gt;  numbers = commaSep integer</span><span>
</span><span id="line-758"></span><span>
</span><span id="line-759"></span><span id="local-6989586621679059298"><span id="local-6989586621679059299"><span id="local-6989586621679059300"><span class="annot"><a href="Text.Parsec.Prim.html#parse"><span class="hs-identifier hs-type">parse</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#Stream"><span class="hs-identifier hs-type">Stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059300"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Identity.html#Identity"><span class="hs-identifier hs-type">Identity</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059299"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-760"></span><span>      </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#Parsec"><span class="hs-identifier hs-type">Parsec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059300"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679059298"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourceName"><span class="hs-identifier hs-type">SourceName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059300"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="Text.Parsec.Error.html#ParseError"><span class="hs-identifier hs-type">ParseError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059298"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-761"></span><span id="parse"><span class="annot"><span class="annottext">parse :: forall s t a.
Stream s Identity t =&gt;
Parsec s () a -&gt; String -&gt; s -&gt; Either ParseError a
</span><a href="Text.Parsec.Prim.html#parse"><span class="hs-identifier hs-var hs-var">parse</span></a></span></span><span> </span><span id="local-6989586621679058451"><span class="annot"><span class="annottext">Parsec s () a
</span><a href="#local-6989586621679058451"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Parsec s () a -&gt; () -&gt; String -&gt; s -&gt; Either ParseError a
forall s t u a.
Stream s Identity t =&gt;
Parsec s u a -&gt; u -&gt; String -&gt; s -&gt; Either ParseError a
</span><a href="Text.Parsec.Prim.html#runP"><span class="hs-identifier hs-var">runP</span></a></span><span> </span><span class="annot"><span class="annottext">Parsec s () a
</span><a href="#local-6989586621679058451"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-762"></span><span>
</span><span id="line-763"></span><span class="hs-comment">-- | The expression @parseTest p input@ applies a parser @p@ against</span><span>
</span><span id="line-764"></span><span class="hs-comment">-- input @input@ and prints the result to stdout. Used for testing</span><span>
</span><span id="line-765"></span><span class="hs-comment">-- parsers.</span><span>
</span><span id="line-766"></span><span>
</span><span id="line-767"></span><span id="local-6989586621679059292"><span id="local-6989586621679059293"><span id="local-6989586621679059294"><span class="annot"><a href="Text.Parsec.Prim.html#parseTest"><span class="hs-identifier hs-type">parseTest</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#Stream"><span class="hs-identifier hs-type">Stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059294"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Identity.html#Identity"><span class="hs-identifier hs-type">Identity</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059293"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059292"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-768"></span><span>          </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#Parsec"><span class="hs-identifier hs-type">Parsec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059294"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679059292"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059294"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-769"></span><span id="parseTest"><span class="annot"><span class="annottext">parseTest :: forall s t a.
(Stream s Identity t, Show a) =&gt;
Parsec s () a -&gt; s -&gt; IO ()
</span><a href="Text.Parsec.Prim.html#parseTest"><span class="hs-identifier hs-var hs-var">parseTest</span></a></span></span><span> </span><span id="local-6989586621679058442"><span class="annot"><span class="annottext">Parsec s () a
</span><a href="#local-6989586621679058442"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679058441"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058441"><span class="hs-identifier hs-var">input</span></a></span></span><span>
</span><span id="line-770"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Parsec s () a -&gt; String -&gt; s -&gt; Either ParseError a
forall s t a.
Stream s Identity t =&gt;
Parsec s () a -&gt; String -&gt; s -&gt; Either ParseError a
</span><a href="Text.Parsec.Prim.html#parse"><span class="hs-identifier hs-var">parse</span></a></span><span> </span><span class="annot"><span class="annottext">Parsec s () a
</span><a href="#local-6989586621679058442"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058441"><span class="hs-identifier hs-var">input</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-771"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621679058440"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058440"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO ()
</span><a href="../../base/src/System.IO.html#putStr"><span class="hs-identifier hs-var">putStr</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;parse error at &quot;</span></span><span>
</span><span id="line-772"></span><span>                       </span><span class="annot"><span class="annottext">ParseError -&gt; IO ()
forall a. Show a =&gt; a -&gt; IO ()
</span><a href="../../base/src/System.IO.html#print"><span class="hs-identifier hs-var">print</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679058440"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-773"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679058438"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058438"><span class="hs-identifier hs-var">x</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; IO ()
forall a. Show a =&gt; a -&gt; IO ()
</span><a href="../../base/src/System.IO.html#print"><span class="hs-identifier hs-var">print</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679058438"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-774"></span><span>
</span><span id="line-775"></span><span class="hs-comment">-- &lt; Parser state combinators</span><span>
</span><span id="line-776"></span><span>
</span><span id="line-777"></span><span class="hs-comment">-- | Returns the current source position. See also 'SourcePos'.</span><span>
</span><span id="line-778"></span><span>
</span><span id="line-779"></span><span id="local-6989586621679059285"><span id="local-6989586621679059286"><span id="local-6989586621679059287"><span class="annot"><a href="Text.Parsec.Prim.html#getPosition"><span class="hs-identifier hs-type">getPosition</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059287"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059286"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059285"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059287"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span></span></span></span><span>
</span><span id="line-780"></span><span id="getPosition"><span class="annot"><span class="annottext">getPosition :: forall (m :: * -&gt; *) s u. Monad m =&gt; ParsecT s u m SourcePos
</span><a href="Text.Parsec.Prim.html#getPosition"><span class="hs-identifier hs-var hs-var">getPosition</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679058433"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058433"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m (State s u)
forall (m :: * -&gt; *) s u. Monad m =&gt; ParsecT s u m (State s u)
</span><a href="Text.Parsec.Prim.html#getParserState"><span class="hs-identifier hs-var">getParserState</span></a></span><span>
</span><span id="line-781"></span><span>                 </span><span class="annot"><span class="annottext">SourcePos -&gt; ParsecT s u m SourcePos
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">State s u -&gt; SourcePos
forall s u. State s u -&gt; SourcePos
</span><a href="Text.Parsec.Prim.html#statePos"><span class="hs-identifier hs-var hs-var">statePos</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058433"><span class="hs-identifier hs-var">state</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-782"></span><span>
</span><span id="line-783"></span><span class="hs-comment">-- | Returns the current input</span><span>
</span><span id="line-784"></span><span>
</span><span id="line-785"></span><span id="local-6989586621679059276"><span id="local-6989586621679059277"><span id="local-6989586621679059278"><span class="annot"><a href="Text.Parsec.Prim.html#getInput"><span class="hs-identifier hs-type">getInput</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059278"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059277"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059276"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059278"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059277"><span class="hs-identifier hs-type">s</span></a></span></span></span></span><span>
</span><span id="line-786"></span><span id="getInput"><span class="annot"><span class="annottext">getInput :: forall (m :: * -&gt; *) s u. Monad m =&gt; ParsecT s u m s
</span><a href="Text.Parsec.Prim.html#getInput"><span class="hs-identifier hs-var hs-var">getInput</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679058428"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058428"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParsecT s u m (State s u)
forall (m :: * -&gt; *) s u. Monad m =&gt; ParsecT s u m (State s u)
</span><a href="Text.Parsec.Prim.html#getParserState"><span class="hs-identifier hs-var">getParserState</span></a></span><span>
</span><span id="line-787"></span><span>              </span><span class="annot"><span class="annottext">s -&gt; ParsecT s u m s
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">State s u -&gt; s
forall s u. State s u -&gt; s
</span><a href="Text.Parsec.Prim.html#stateInput"><span class="hs-identifier hs-var hs-var">stateInput</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058428"><span class="hs-identifier hs-var">state</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-788"></span><span>
</span><span id="line-789"></span><span class="hs-comment">-- | @setPosition pos@ sets the current source position to @pos@.</span><span>
</span><span id="line-790"></span><span>
</span><span id="line-791"></span><span id="local-6989586621679059270"><span id="local-6989586621679059271"><span id="local-6989586621679059272"><span class="annot"><a href="Text.Parsec.Prim.html#setPosition"><span class="hs-identifier hs-type">setPosition</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059272"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059271"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059270"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059272"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-792"></span><span id="setPosition"><span class="annot"><span class="annottext">setPosition :: forall (m :: * -&gt; *) s u. Monad m =&gt; SourcePos -&gt; ParsecT s u m ()
</span><a href="Text.Parsec.Prim.html#setPosition"><span class="hs-identifier hs-var hs-var">setPosition</span></a></span></span><span> </span><span id="local-6989586621679058424"><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058424"><span class="hs-identifier hs-var">pos</span></a></span></span><span>
</span><span id="line-793"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">State s u
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(State s u -&gt; State s u) -&gt; ParsecT s u m (State s u)
forall s u (m :: * -&gt; *).
(State s u -&gt; State s u) -&gt; ParsecT s u m (State s u)
</span><a href="Text.Parsec.Prim.html#updateParserState"><span class="hs-identifier hs-var">updateParserState</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span id="local-6989586621679058423"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058423"><span class="hs-identifier hs-var">input</span></a></span></span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679058422"><span class="annot"><span class="annottext">u
</span><a href="#local-6989586621679058422"><span class="hs-identifier hs-var">user</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">s -&gt; SourcePos -&gt; u -&gt; State s u
forall s u. s -&gt; SourcePos -&gt; u -&gt; State s u
</span><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-var">State</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058423"><span class="hs-identifier hs-var">input</span></a></span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058424"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">u
</span><a href="#local-6989586621679058422"><span class="hs-identifier hs-var">user</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-794"></span><span>         </span><span class="annot"><span class="annottext">() -&gt; ParsecT s u m ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-795"></span><span>
</span><span id="line-796"></span><span class="hs-comment">-- | @setInput input@ continues parsing with @input@. The 'getInput' and</span><span>
</span><span id="line-797"></span><span class="hs-comment">-- @setInput@ functions can for example be used to deal with #include</span><span>
</span><span id="line-798"></span><span class="hs-comment">-- files.</span><span>
</span><span id="line-799"></span><span>
</span><span id="line-800"></span><span id="local-6989586621679059261"><span id="local-6989586621679059262"><span id="local-6989586621679059263"><span class="annot"><a href="Text.Parsec.Prim.html#setInput"><span class="hs-identifier hs-type">setInput</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059263"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059262"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059262"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059261"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059263"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-801"></span><span id="setInput"><span class="annot"><span class="annottext">setInput :: forall (m :: * -&gt; *) s u. Monad m =&gt; s -&gt; ParsecT s u m ()
</span><a href="Text.Parsec.Prim.html#setInput"><span class="hs-identifier hs-var hs-var">setInput</span></a></span></span><span> </span><span id="local-6989586621679058418"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058418"><span class="hs-identifier hs-var">input</span></a></span></span><span>
</span><span id="line-802"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">State s u
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(State s u -&gt; State s u) -&gt; ParsecT s u m (State s u)
forall s u (m :: * -&gt; *).
(State s u -&gt; State s u) -&gt; ParsecT s u m (State s u)
</span><a href="Text.Parsec.Prim.html#updateParserState"><span class="hs-identifier hs-var">updateParserState</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679058417"><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058417"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span id="local-6989586621679058416"><span class="annot"><span class="annottext">u
</span><a href="#local-6989586621679058416"><span class="hs-identifier hs-var">user</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">s -&gt; SourcePos -&gt; u -&gt; State s u
forall s u. s -&gt; SourcePos -&gt; u -&gt; State s u
</span><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-var">State</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679058418"><span class="hs-identifier hs-var">input</span></a></span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679058417"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">u
</span><a href="#local-6989586621679058416"><span class="hs-identifier hs-var">user</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-803"></span><span>         </span><span class="annot"><span class="annottext">() -&gt; ParsecT s u m ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-804"></span><span>
</span><span id="line-805"></span><span class="hs-comment">-- | Returns the full parser state as a 'State' record.</span><span>
</span><span id="line-806"></span><span>
</span><span id="line-807"></span><span id="local-6989586621679059279"><span id="local-6989586621679059280"><span id="local-6989586621679059281"><span class="annot"><a href="Text.Parsec.Prim.html#getParserState"><span class="hs-identifier hs-type">getParserState</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059281"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059280"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059279"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059281"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059280"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059279"><span class="hs-identifier hs-type">u</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-808"></span><span id="getParserState"><span class="annot"><span class="annottext">getParserState :: forall (m :: * -&gt; *) s u. Monad m =&gt; ParsecT s u m (State s u)
</span><a href="Text.Parsec.Prim.html#getParserState"><span class="hs-identifier hs-var hs-var">getParserState</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State s u -&gt; State s u) -&gt; ParsecT s u m (State s u)
forall s u (m :: * -&gt; *).
(State s u -&gt; State s u) -&gt; ParsecT s u m (State s u)
</span><a href="Text.Parsec.Prim.html#updateParserState"><span class="hs-identifier hs-var">updateParserState</span></a></span><span> </span><span class="annot"><span class="annottext">State s u -&gt; State s u
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-809"></span><span>
</span><span id="line-810"></span><span class="hs-comment">-- | @setParserState st@ set the full parser state to @st@.</span><span>
</span><span id="line-811"></span><span>
</span><span id="line-812"></span><span id="local-6989586621679059251"><span id="local-6989586621679059252"><span id="local-6989586621679059253"><span class="annot"><a href="Text.Parsec.Prim.html#setParserState"><span class="hs-identifier hs-type">setParserState</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059253"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059252"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059251"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059252"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059251"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059253"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059252"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059251"><span class="hs-identifier hs-type">u</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-813"></span><span id="setParserState"><span class="annot"><span class="annottext">setParserState :: forall (m :: * -&gt; *) s u.
Monad m =&gt;
State s u -&gt; ParsecT s u m (State s u)
</span><a href="Text.Parsec.Prim.html#setParserState"><span class="hs-identifier hs-var hs-var">setParserState</span></a></span></span><span> </span><span id="local-6989586621679058412"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058412"><span class="hs-identifier hs-var">st</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State s u -&gt; State s u) -&gt; ParsecT s u m (State s u)
forall s u (m :: * -&gt; *).
(State s u -&gt; State s u) -&gt; ParsecT s u m (State s u)
</span><a href="Text.Parsec.Prim.html#updateParserState"><span class="hs-identifier hs-var">updateParserState</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">State s u -&gt; State s u -&gt; State s u
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058412"><span class="hs-identifier hs-var">st</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-814"></span><span>
</span><span id="line-815"></span><span class="hs-comment">-- | @updateParserState f@ applies function @f@ to the parser state.</span><span>
</span><span id="line-816"></span><span>
</span><span id="line-817"></span><span id="local-6989586621679059264"><span id="local-6989586621679059265"><span id="local-6989586621679059266"><span class="annot"><a href="Text.Parsec.Prim.html#updateParserState"><span class="hs-identifier hs-type">updateParserState</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059266"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059265"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059266"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059265"><span class="hs-identifier hs-type">u</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059266"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059265"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059264"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059266"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059265"><span class="hs-identifier hs-type">u</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-818"></span><span id="updateParserState"><span class="annot"><span class="annottext">updateParserState :: forall s u (m :: * -&gt; *).
(State s u -&gt; State s u) -&gt; ParsecT s u m (State s u)
</span><a href="Text.Parsec.Prim.html#updateParserState"><span class="hs-identifier hs-var hs-var">updateParserState</span></a></span></span><span> </span><span id="local-6989586621679058411"><span class="annot"><span class="annottext">State s u -&gt; State s u
</span><a href="#local-6989586621679058411"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-819"></span><span>    </span><span class="annot"><span class="annottext">(forall b.
 State s u
 -&gt; (State s u -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (State s u -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m (State s u)
forall s u (m :: * -&gt; *) a.
(forall b.
 State s u
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; (a -&gt; State s u -&gt; ParseError -&gt; m b)
 -&gt; (ParseError -&gt; m b)
 -&gt; m b)
-&gt; ParsecT s u m a
</span><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-var">ParsecT</span></a></span><span> </span><span class="annot"><span class="annottext">((forall b.
  State s u
  -&gt; (State s u -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; (State s u -&gt; State s u -&gt; ParseError -&gt; m b)
  -&gt; (ParseError -&gt; m b)
  -&gt; m b)
 -&gt; ParsecT s u m (State s u))
-&gt; (forall b.
    State s u
    -&gt; (State s u -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; (State s u -&gt; State s u -&gt; ParseError -&gt; m b)
    -&gt; (ParseError -&gt; m b)
    -&gt; m b)
-&gt; ParsecT s u m (State s u)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679058410"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058410"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="annot"><span class="annottext">State s u -&gt; State s u -&gt; ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679058409"><span class="annot"><span class="annottext">State s u -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058409"><span class="hs-identifier hs-var">eok</span></a></span></span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; m b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-820"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679058408"><span class="annot"><span class="annottext">s' :: State s u
</span><a href="#local-6989586621679058408"><span class="hs-identifier hs-var hs-var">s'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">State s u -&gt; State s u
</span><a href="#local-6989586621679058411"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058410"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-821"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">State s u -&gt; State s u -&gt; ParseError -&gt; m b
</span><a href="#local-6989586621679058409"><span class="hs-identifier hs-var">eok</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058408"><span class="hs-identifier hs-var">s'</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058408"><span class="hs-identifier hs-var">s'</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseError -&gt; m b) -&gt; ParseError -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">State s u -&gt; ParseError
forall s u. State s u -&gt; ParseError
</span><a href="Text.Parsec.Prim.html#unknownError"><span class="hs-identifier hs-var">unknownError</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058408"><span class="hs-identifier hs-var">s'</span></a></span><span>
</span><span id="line-822"></span><span>
</span><span id="line-823"></span><span class="hs-comment">-- &lt; User state combinators</span><span>
</span><span id="line-824"></span><span>
</span><span id="line-825"></span><span class="hs-comment">-- | Returns the current user state.</span><span>
</span><span id="line-826"></span><span>
</span><span id="line-827"></span><span id="local-6989586621679059241"><span id="local-6989586621679059242"><span id="local-6989586621679059243"><span class="annot"><a href="Text.Parsec.Prim.html#getState"><span class="hs-identifier hs-type">getState</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059243"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059242"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059241"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059243"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059241"><span class="hs-identifier hs-type">u</span></a></span></span></span></span><span>
</span><span id="line-828"></span><span id="getState"><span class="annot"><span class="annottext">getState :: forall (m :: * -&gt; *) s u. Monad m =&gt; ParsecT s u m u
</span><a href="Text.Parsec.Prim.html#getState"><span class="hs-identifier hs-var hs-var">getState</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">State s u -&gt; u
forall s u. State s u -&gt; u
</span><a href="Text.Parsec.Prim.html#stateUser"><span class="hs-identifier hs-var hs-var">stateUser</span></a></span><span> </span><span class="annot"><span class="annottext">(State s u -&gt; u) -&gt; ParsecT s u m (State s u) -&gt; ParsecT s u m u
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-operator hs-var">`liftM`</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT s u m (State s u)
forall (m :: * -&gt; *) s u. Monad m =&gt; ParsecT s u m (State s u)
</span><a href="Text.Parsec.Prim.html#getParserState"><span class="hs-identifier hs-var">getParserState</span></a></span><span>
</span><span id="line-829"></span><span>
</span><span id="line-830"></span><span class="hs-comment">-- | @putState st@ set the user state to @st@.</span><span>
</span><span id="line-831"></span><span>
</span><span id="line-832"></span><span id="local-6989586621679059232"><span id="local-6989586621679059233"><span id="local-6989586621679059234"><span class="annot"><a href="Text.Parsec.Prim.html#putState"><span class="hs-identifier hs-type">putState</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059234"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059233"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059232"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059233"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059234"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-833"></span><span id="putState"><span class="annot"><span class="annottext">putState :: forall (m :: * -&gt; *) u s. Monad m =&gt; u -&gt; ParsecT s u m ()
</span><a href="Text.Parsec.Prim.html#putState"><span class="hs-identifier hs-var hs-var">putState</span></a></span></span><span> </span><span id="local-6989586621679058400"><span class="annot"><span class="annottext">u
</span><a href="#local-6989586621679058400"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">State s u
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(State s u -&gt; State s u) -&gt; ParsecT s u m (State s u)
forall s u (m :: * -&gt; *).
(State s u -&gt; State s u) -&gt; ParsecT s u m (State s u)
</span><a href="Text.Parsec.Prim.html#updateParserState"><span class="hs-identifier hs-var">updateParserState</span></a></span><span> </span><span class="annot"><span class="annottext">((State s u -&gt; State s u) -&gt; ParsecT s u m (State s u))
-&gt; (State s u -&gt; State s u) -&gt; ParsecT s u m (State s u)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679058399"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058399"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058399"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">stateUser :: u
</span><a href="Text.Parsec.Prim.html#stateUser"><span class="hs-identifier hs-var">stateUser</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">u
</span><a href="#local-6989586621679058400"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-834"></span><span>                </span><span class="annot"><span class="annottext">() -&gt; ParsecT s u m ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-835"></span><span>
</span><span id="line-836"></span><span class="hs-comment">-- | @modifyState f@ applies function @f@ to the user state. Suppose</span><span>
</span><span id="line-837"></span><span class="hs-comment">-- that we want to count identifiers in a source, we could use the user</span><span>
</span><span id="line-838"></span><span class="hs-comment">-- state as:</span><span>
</span><span id="line-839"></span><span class="hs-comment">--</span><span>
</span><span id="line-840"></span><span class="hs-comment">-- &gt;  expr  = do{ x &lt;- identifier</span><span>
</span><span id="line-841"></span><span class="hs-comment">-- &gt;            ; modifyState (+1)</span><span>
</span><span id="line-842"></span><span class="hs-comment">-- &gt;            ; return (Id x)</span><span>
</span><span id="line-843"></span><span class="hs-comment">-- &gt;            }</span><span>
</span><span id="line-844"></span><span>
</span><span id="line-845"></span><span id="local-6989586621679059226"><span id="local-6989586621679059227"><span id="local-6989586621679059228"><span class="annot"><a href="Text.Parsec.Prim.html#modifyState"><span class="hs-identifier hs-type">modifyState</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059228"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059227"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059227"><span class="hs-identifier hs-type">u</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059226"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059227"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059228"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-846"></span><span id="modifyState"><span class="annot"><span class="annottext">modifyState :: forall (m :: * -&gt; *) u s. Monad m =&gt; (u -&gt; u) -&gt; ParsecT s u m ()
</span><a href="Text.Parsec.Prim.html#modifyState"><span class="hs-identifier hs-var hs-var">modifyState</span></a></span></span><span> </span><span id="local-6989586621679058395"><span class="annot"><span class="annottext">u -&gt; u
</span><a href="#local-6989586621679058395"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">State s u
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(State s u -&gt; State s u) -&gt; ParsecT s u m (State s u)
forall s u (m :: * -&gt; *).
(State s u -&gt; State s u) -&gt; ParsecT s u m (State s u)
</span><a href="Text.Parsec.Prim.html#updateParserState"><span class="hs-identifier hs-var">updateParserState</span></a></span><span> </span><span class="annot"><span class="annottext">((State s u -&gt; State s u) -&gt; ParsecT s u m (State s u))
-&gt; (State s u -&gt; State s u) -&gt; ParsecT s u m (State s u)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679058394"><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058394"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058394"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">stateUser :: u
</span><a href="Text.Parsec.Prim.html#stateUser"><span class="hs-identifier hs-var">stateUser</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">u -&gt; u
</span><a href="#local-6989586621679058395"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">State s u -&gt; u
forall s u. State s u -&gt; u
</span><a href="Text.Parsec.Prim.html#stateUser"><span class="hs-identifier hs-var hs-var">stateUser</span></a></span><span> </span><span class="annot"><span class="annottext">State s u
</span><a href="#local-6989586621679058394"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-847"></span><span>                   </span><span class="annot"><span class="annottext">() -&gt; ParsecT s u m ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-848"></span><span>
</span><span id="line-849"></span><span class="hs-comment">-- XXX Compat</span><span>
</span><span id="line-850"></span><span>
</span><span id="line-851"></span><span class="hs-comment">-- | An alias for putState for backwards compatibility.</span><span>
</span><span id="line-852"></span><span>
</span><span id="line-853"></span><span id="local-6989586621679058391"><span id="local-6989586621679058392"><span id="local-6989586621679058393"><span class="annot"><a href="Text.Parsec.Prim.html#setState"><span class="hs-identifier hs-type">setState</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058393"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679058392"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058391"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058392"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058393"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-854"></span><span id="setState"><span class="annot"><span class="annottext">setState :: forall (m :: * -&gt; *) u s. Monad m =&gt; u -&gt; ParsecT s u m ()
</span><a href="Text.Parsec.Prim.html#setState"><span class="hs-identifier hs-var hs-var">setState</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">u -&gt; ParsecT s u m ()
forall (m :: * -&gt; *) u s. Monad m =&gt; u -&gt; ParsecT s u m ()
</span><a href="Text.Parsec.Prim.html#putState"><span class="hs-identifier hs-var">putState</span></a></span><span>
</span><span id="line-855"></span><span>
</span><span id="line-856"></span><span class="hs-comment">-- | An alias for modifyState for backwards compatibility.</span><span>
</span><span id="line-857"></span><span>
</span><span id="line-858"></span><span id="local-6989586621679058386"><span id="local-6989586621679058387"><span id="local-6989586621679058388"><span class="annot"><a href="Text.Parsec.Prim.html#updateState"><span class="hs-identifier hs-type">updateState</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058388"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679058387"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679058387"><span class="hs-identifier hs-type">u</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058386"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058387"><span class="hs-identifier hs-type">u</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058388"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-859"></span><span id="updateState"><span class="annot"><span class="annottext">updateState :: forall (m :: * -&gt; *) u s. Monad m =&gt; (u -&gt; u) -&gt; ParsecT s u m ()
</span><a href="Text.Parsec.Prim.html#updateState"><span class="hs-identifier hs-var hs-var">updateState</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(u -&gt; u) -&gt; ParsecT s u m ()
forall (m :: * -&gt; *) u s. Monad m =&gt; (u -&gt; u) -&gt; ParsecT s u m ()
</span><a href="Text.Parsec.Prim.html#modifyState"><span class="hs-identifier hs-var">modifyState</span></a></span><span>
</span><span id="line-860"></span></pre></body></html>